My json is structured as follows:
{
"data": {
"item1": {
"field1": "foo",
"field2": "bar",
"field3": "baz"
},
"item2": {
"field1": "foo1",
"field2": "bar1",
"field3": "baz1"
},
}
}
When I normalize this data structure using pd.io.json.json_normalize
, I get a data frame with 1 row and the column headings repeated for each data item. How do I get the repeated columns to appear as rows instead of columns?
I currently get this
field1 | field2 | field3 | field1 |field2 | field3
foo | bar | baz | foo1 | bar1 | baz1
What I want is:
field1 | field2 | field3 |
foo | bar | baz
foo1 | bar1 | baz1