convert dict to dataframe
#Lazy way to convert json dict to df
pd.DataFrame.from_dict(data, orient='index').T
convert dict to dataframe
#Lazy way to convert json dict to df
pd.DataFrame.from_dict(data, orient='index').T
dataframe to dictionary
>>> df.to_dict('records')
[{'col1': 1, 'col2': 0.5}, {'col1': 2, 'col2': 0.75}]
dataframe to dict without index
df.to_dict('index')
dataframe to dictionary using index as key
#Use the Dataframe index as the key of the dictionary
df.to_dict('index')
turn df to dict
dict(df.values)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us