I am trying to loop through different JSON arrays using Python, in order to combine all the objects into a single data structure. The JSON looks like this:
data = {
"Wednesday, Apr 3, 2019": [
{
"id": "000",
"keyid": "4273666087",
"name": "Raptor",
"symbol": "RPT",
},
{
"id": "111",
"keyid": "1818114564",
"name": "Duck",
"symbol": "DUK",
}
],
"Tuesday, Apr 2, 2019": [
{
"id": "222",
"keyid": "8032408148",
"name": "Hawk",
"symbol": "HWK",
},
{
"id": "333",
"keyid": "0362766431",
"name": "Goose",
"symbol": "GOO",
}
]
}
Since it looks like a dictionary, I tried doing:
for item in data.values():
print(item)
print("\n")
which combines each array's objects into a separate lists. But I want all objects to be part of the same data structure, in order for the end result to look something like this:
id | keyid | name | symbol
-----------------------------------
000 | 4273666087 | Raptor | RPT
-----------------------------------
111 | 1818114564 | Duck | DUK
-----------------------------------
222 | 8032408148 | Hawk | HWK
-----------------------------------
333 | 0362766431 | Goose | GOO
-----------------------------------
What's the best way of doing this?