Home > Blockchain >  Not able to convert dict as pandas dataframe
Not able to convert dict as pandas dataframe

Time:08-12

I have the following dict :

enter image description here

My goal is to convert it as a dataframe :

Tenor Type Rate
EDH3 Comdty 310 DY FUTURE_RATE 3.84000000
EDM3 Comdty 401 DY FUTURE_RATE 3.71999999

Doing the following give me a non wanted ouput.

EDH3 Comdty EDM3 Comdty
0 {'Tenor': '310 DY', 'Type': 'FUTURE_RATE', 'Rate': 3.84000000} {'Tenor': '401 DY', 'Type': 'CASH', 'Rate': 3.71999999}

Below is what I did try :

pd.DataFrame(results.items())

The keys should be the index in the wanted output.

CodePudding user response:

Try:

pd.DataFrame(df['Value'].tolist(),index = df['Key'])
  • Related