-1

I have a dictionnary like this :

dict = {'A': {'0': aaa, '1': bbb, '2': ccc}, 'B': {'0': 0, '1': 6, '2': 0}, 'C': {'0': 1, '1': 2, '2': 3}}

How can I transform it into a dataframe so that the dataframe looks like this:

     A      B       C
0   aaa     0       1
1   bbb     6       2
2   ccc     0       3

I tried looking at the from_dict() function but could not find a way to transform it like this.

Any ideas what I could use?

colla
  • 717
  • 1
  • 10
  • 22

1 Answers1

0

You can convert the nested dictionaries to dataframe using this:

df = pd.DataFrame(dict)

Muhammed Jaseem
  • 782
  • 6
  • 18