试图将嵌套的 JSON 转换为当前数据框的列。我该如何做到这一点?注意:字典的 JSON 函数列表重复 600 多次
{
"Functions": [
{
"CodeSha256": "",
"CodeSize":
"Description": "",
"Environment": {
"Variables": {
"COMMIT_HASH": ",
"CodeSha256": "",
"ECS_LOG_STREAM": "",
"ELASTIC_SEARCH_DOMAIN_ENDPOINT": "",
"ENVIRONMENT": "prod",
"SERVICE_NAME": "testingservicename",
"SERVICE_OWNER": "testingserviceowner",
}
},
"FunctionName": "demofunctionname",
"Timeout": ,
"TracingConfig": {
"Mode":
},
"Version": "",
"VpcConfig": {
"SecurityGroupIds": [
""
],
"SubnetIds": [
"",
"",
""
],
"VpcId": ""
}
}
] }
我如何加载 json
data = json.load(open('../fileservice.json'))
df = pd.DataFrame(data["Functions"])
它是如何出现的
FunctionName Environment
0 demofunctionname {Variables{"COMMIT_HASH":"djkdkd","SERVICE_OWNER":"serviceownertest"}}
我需要它如何出现
FunctionName COMMIT_HASH SERVICE_OWNER
0 demofunctionname djkdkd serviceownertest
一直在尝试爆炸方法,但没有完成工作。非常感谢任何建议或指导。