AlexanderBerezo
5 years agoQrew Member
Can't use pandas.read_json() with new QB RESTFul API
Hi,
I try to use inbuilt pandas read_json with new RESTFull QB API, but it doesn't work, even though I tried every orient and typ.
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_json.html
Using the most fitting orient
I get ValueError: JSON data had unexpected key(s): fields, metadata
I've already came up with a workaround using
------------------------------
Alexander Berezovskiy
------------------------------
I try to use inbuilt pandas read_json with new RESTFull QB API, but it doesn't work, even though I tried every orient and typ.
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_json.html
Using the most fitting orient
'split'
: dict like {index -> [index], columns -> [columns], data -> [values]}
I get ValueError: JSON data had unexpected key(s): fields, metadata
I've already came up with a workaround using
pd.DataFrame.from_dict(r.json()['data']).applymap(lambda x: list(x.values())[0])
but it's not fully functional.
Any ideas, what am I doing wrong? Maybe someone already had experience processing QB JSON in Python...
but it's not fully functional.
Any ideas, what am I doing wrong? Maybe someone already had experience processing QB JSON in Python...
------------------------------
Alexander Berezovskiy
------------------------------