Skip to content
Advertisement

Pythonic way to extract keys and multiple values from a list of dicts

I have some code which works, data is read in from a text file as a list of dicts, the code takes the keys and values from each dict in for loops. While it works I am sure there is a better way to do it than mine below:

Code

JavaScript

Outputs

JavaScript

Advertisement

Answer

I would recommand using pandas.DataFrame very convenient way to

JavaScript

Regards

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement