I have the following dict :
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'])