Categories
Python Answers

How to convert Python dict into a Pandas dataframe?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *