[
{
"ver": "1",
"dt": 1699439129329,
"od": "OBJECT_ID",
"bin": "Vbin",
"myname": "VME",
"msgss": [
{
"code": "TLHGH",
"Details": {
"no": 1,
"rep": 4
},
"pngds": [
{
"id": "ID",
"mpo": 16,
"mkg": "up",
}
] }
] },
{
"ver": "2",
"dt": 1699439129329,
"od": "OBJECT_ID",
"bin": "Vbin",
"myname": "VME",
"msgss": [
{
"code": "TLHGH",
"Details": {
"no": 1,
"rep": 4
},
"pngds": [
{
"id": "ID",
"mpo": 16,
"mkg": "up",
}
] }
] }
]
{
"ver": "1",
"dt": 1699439129329,
"od": "OBJECT_ID",
"bin": "Vbin",
"myname": "VME",
"msgss": [
{
"code": "TLHGH",
"Details": {
"no": 1,
"rep": 4
},
"pngds": [
{
"id": "ID",
"mpo": 16,
"mkg": "up",
}
] }
] },
{
"ver": "2",
"dt": 1699439129329,
"od": "OBJECT_ID",
"bin": "Vbin",
"myname": "VME",
"msgss": [
{
"code": "TLHGH",
"Details": {
"no": 1,
"rep": 4
},
"pngds": [
{
"id": "ID",
"mpo": 16,
"mkg": "up",
}
] }
] }
]
I need to parse above json and get the output details like below.
2
Answers
Use nested list comprehension for flatten values to list of dictionaries and call
DataFrame
constructor:You can use
pandas.json_normalize
: