Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate a pandas dataframe from ordereddict?

Tags:

pandas

How can i generated a pandas dataframe from an ordereddict?

I have tried using the dataframe.from_dict method but that is not giving me the expected dataframe.

What is the best approach to convert an ordereddict into a list of dicts?

like image 322
prd999 Avatar asked Dec 11 '22 09:12

prd999


1 Answers

A bug in Pandas did not respect the key ordering of OrderedDict objects converted to a DataFrame via the from_dict call. Fixed in Pandas 0.11.

like image 183
Malina Avatar answered Feb 12 '23 16:02

Malina