I have a json variable named json_results and I am running pandas.json_normalize(json_results). It raises the following error:
in _json_normalize
raise NotImplementedError
NotImplementedError
How can I resolve this?
This error can happen if you pass a JSON string to json_normalize, not an already decoded JSON object.
>>> import json
>>> import pandas as pd
>>> s = '{"hello": "world"}'
>>> pd.json_normalize(s)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../lib/python3.7/site-packages/pandas/io/json/_normalize.py", line 423, in _json_normalize
raise NotImplementedError
NotImplementedError
>>> d = json.loads(s)
>>> pd.json_normalize(d)
hello
0 world
If this is the case, use json.loads (or an equivalent Pandas function) first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With