Hi I have a dictionary of dictionaries as shown (copied example). I would like to convert it into a tall DataFrame
.
Example dictionary:
{'Jill': {'Avenger: Age of Ultron': 7.0,
'Django Unchained': 6.5,
'Gone Girl': 9.0,
'Kill the Messenger': 8.0},
'Toby': {'Avenger: Age of Ultron': 8.5,
'Django Unchained': 9.0,
'Zoolander': 2.0}}
Expected tall dataframe look like below:
Column1 Column2 Column3
Jill Avenger: Age of Ultron 7.0
Jill Django Unchained 6.5
Jill Gone Girl 9.0
Jill Kill the Messenger 8.0
Toby Avenger: Age of Ultron 8.5
Toby Django Unchained 9.0
Toby Zoolander 2.0
I tried the below, it gives me main keys of dictionaries as first column, but couldn't make it as tall dataframe:
pd.DataFrame.from_dict(d, orient='index')