Conversion of list of dictionary and dataframe in Python

In Python there is a dataframe package: pandas. The dataframe package simplifies a lot of things and it is comparable to a dataframe in R. Sometime you need convert a list of dictionary to a dataframe and vice versa.

To use dataframe you need import pandas.

To convert a list of dictionary to a dataframe, use the following:


To convert a dataframe to a list of dictionary, use the following:


This entry was posted in Python and tagged , , , . Bookmark the permalink.

Leave a Reply