Menu Close

How to convert Python dict into a Pandas dataframe?

To convert Python dict into a Pandas dataframe, we can call DataFrame with the dictuionary.

For instance, we write

dict_ = {'key 1': 'value 1', 'key 2': 'value 2', 'key 3': 'value 3'}
pd.DataFrame([dict_])

to call DataFrame with the dict_ dictionary in a list to create the data frame.

Posted in Python, Python Answers