This is what one row of themesdf
looks like:
[{'code': '1', 'name': 'Economic management'},
{'code': '6', 'name': 'Social protection and risk management'}]
I want to normalize each row and add it to a newdf
. This is what I have right now:
import pandas as pd
themesdf = json_df['mjtheme_namecode']
newdf = pd.DataFrame()
%timeit()
for row in themesdf:
for item in row:
newdf.append(json_normalize(item, 'name'))
newdf
After printing out newdf
, it comes it with nothing. My ultimate goal with this data is to get the top ten major project themes (column 'name'
).