I have a nested json file that doesn't have a unified structure, like the following sample:
[{ "name": "Jon", "last": "Jonny"},
{"name": "Jimmy", "last": "johnson", "kids":[{"kidName":"johnson_junior","kidAge": "1"}, {"kidName":"johnson_junior2", "kidAge": "4"}]}]
See that in the second item there is list name "kids" that doesn't exists in the first item.
When i tries to flat the json with pandas json_normalize it Throws out error message : "KeyError: 'kids'"
This is the json_normalize command:
flat_json = json_normalize(json_file, record_path= 'kids', errors='ignore')
it seems that json_normalize doesn't support nested json that doesn't have unified structure.
Has someone experienced the same issue? Do you have an idea on how to get through it?