I have a dict of Pandas Dataframes, say
d = {A: pd.DataFrame([[0, 1, 2], [2, 2, 4]), B: pd.DataFrame([[1, 1, 1], [2, 2, 2]}
and I\'d like
Use pd.concat on the dictionary values, with the keys parameter set to the dictionary keys:
keys
df = pd.concat(d.values(), keys=d.keys())
The resulting output:
0 1 2 A 0 0 1 2 1 2 2 4 B 0 1 1 1 1 2 2 2