python3如何遍历json数据
json和pandas配合下
import json import pandas as pd js=‘‘‘ { "message":"abc","result":{ "paramtypeitems":[ {"name":"基本参数","paramitems":[ {"id":567,"name":"车型","valueitems":[ {"specid":37017,"value":"xDrive40i M运动套装"}, {"specid":37018,"value":"xDrive40i 尊享型 M运动套装"}, {"specid":33307,"value":"xDrive28i"}] }] }] } } ‘‘‘ dj=json.loads(js) d=dj[‘result‘][‘paramtypeitems‘][0][‘paramitems‘][0][‘valueitems‘] df=pd.DataFrame(d) print(df)