I am having trouble extracting data from nested json in python. I want to create a one column pandas dataframe of all the values of "bill", e.g.
bill
----
a1
a2
a3
Using the output from an API formatted like this:
{
"status": "succeeded",
"travels": [
{
"jobs": [
{
"bill": "a1"
},
{
"bill": "a2"
},
{
"bill": "a3"
}
],
"vehicle": {
"plate": "xyz123"
}
}
]
}
Loading the json directly into pandas gives me only the first instance of 'bill'. I have tried json_normalize() on 'jobs', but it has a key error. Can anybody help me figure out how to grab just the 'bill'?
Thanks