How to convert python dictionary to pandas data frame. This is how I do it now, which is not at all elegant.
import pandas as pd MyDict={'key1':'value1','key2' : 'value2'} MyDF=pd.DataFrame.from_dict(MyDict,orient='index',dtype=None) MyDF.index.name = 'Keys' MyDF.reset_index(inplace=True)
I just want the key: value pair in MyDict to be the rows of the pandas data frame.
source share