I have very large json data with the following syntax:
[
{
"origin": 101011001,
"destinations": [
{"destination": 101011001, "people": 7378},
{"destination": 101011002, "people": 120}
]
},
{
"origin": 101011002,
"destinations": [
{"destination": 101011001, "people": 754},
}
]
[enter image description here][1]
My goal is the convert the data to a pandas dataframe which I then want to convert to sql to store as a table in my postgresql database.
I want to create a pandas dataframe like this:
origin destination people
101011001 101011001 7378
101011001 101011002 120
101011002 101011001 754
Right now, I can only get columns 'origin' and 'destinations' where destinations is a list containing both the destination and people values, using pandas.read_json().
How can I achieve the above dataframe?