I'm trying to put a JSON result into a DataFrame using python3.
Here is the Json result I'm working with:
{
"jsonrpc": "2.0",
"result": {
"2": {
"status": "0",
"problems": [],
"sla": [
{
"from": 1582066800,
"to": 1582116906,
"sla": 100,
"okTime": 50106,
"problemTime": 0,
"downtimeTime": 0
}
]
},
"3": {
"status": "0",
"problems": [],
"sla": [
{
"from": 1582066800,
"to": 1582116906,
"sla": 100,
"okTime": 50106,
"problemTime": 0,
"downtimeTime": 0
}
]
}
},
"id": 1
}
So far, I 've been able to get the table for one entry:
df = pd.DataFrame(mydata['result']['2']['sla'])
Now I would like to have all entries in my table. Here is what i would like to get:
hostid from to sla okTime problemTime downtimeTime
2 1582066800 1582116906 100 50106 0 0
3 1582066800 1582116906 100 50106 0 0
How can I proceed ?