我有一个嵌套的json,如下所示:
{
"Invalids":[
{
"Comments":"string",
"InputRequest":{
"LinesInfo":[
{
"LastPipeLineStateIds":[
0
],
"CropId":0
}
],
"Crop":"string",
"Year":"string"
}
},
{
"Comments":"string",
"InputRequest":{
"LinesInfo":[
{
"LastPipeLineStateIds":[
0
],
"CropId":0
}
],
"name":"string",
"number":"string"
}
}
],
"LinesResponse":{ },
"ErrorInfo":"string"
}
如果“Invalids”不是空的,我想得到一个包含“name”和“number”的表。我是这样做的:
a = json_normalize(data['Invalid'])
但是输出有如下前缀:'输入请求名称我不想要。如何获得“name”和“number”的干净列表(以“comments”作为元数据)?你知道吗
你可以这样管理它:
相关问题 更多 >
编程相关推荐