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)

相关文章:

  • 2021-10-19
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-03-09
  • 2021-10-19
  • 2022-12-23
猜你喜欢
  • 2021-12-26
  • 2021-08-23
  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案