explode dictionary pandas

Solutions on MaxInterview for explode dictionary pandas by the best coders in the world

showing results for - "explode dictionary pandas"
Benjamin
20 Jan 2021
1arxivdf.reset_index(inplace=True) # didn't drop the index coz I will need it later
2tmp = arxivdf.explode('data') # 'data' is the column that has a list of dictionaries
3dict2df = tmp['data'].apply(pd.Series)[['category', 'link', 'summary', 'title']] # the column passed are keys, 
4arxivdf = pd.concat((tmp,dict2df),axis=1) # concatenate to have everything in on df