简体   繁体   中英

Python | Convert a JSON dictionary with a list with dictionary entries into a DataFrame (pandas)

I have imported a JSON file with 10000 rows and saved it in the variable data. I want a table that shows the name of the father, the mother, the living situation and the number of pets. For this, I wanted to use a DataFrame from pandas (python). Unfortunately, I don't know how to extract the data. I always get a Family column with {...} entries.

df = pd.DataFrame.from_dict(data)

在此处输入图像描述

在此处输入图像描述

pd.DataFrame.from_dict(data['Family'])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM