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)
原文地址:https://www.cnblogs.com/qianzf/p/12206962.html
时间: 2024-10-18 09:51:09