Skip to content
Advertisement

Python: How to explode column of dictionaries into columns with matching keys?

I have a column in pandas dataframe that has the following structure (see example). I think I have a nested dictionary in a single column, and I want each key to have it’s own column. I want all the matching keys to be the same column. Run the examples for more details

JavaScript

I want to explode the dataframe so that it has the following structure:

JavaScript

Advertisement

Answer

Using json.normalize

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