2021-01-29

How to convert a list with dictionaries into new pandas columns?

I have a dataframe which has a list of dictionaries as a column: This column has the following format:

[{'route_id': '1', 'stop_id': '1'}, {'route_id': '2', 'stop_id': '2'}]

How can I convert this column into 4 new columns? I mean: route_id (x2), stop_id(x2) as new columns.

Thanks in advance!



from Recent Questions - Stack Overflow https://ift.tt/3qPU7WT
https://ift.tt/eA8V8J

No comments:

Post a Comment