Я пытаюсь разобрать одну json строку для получения файла excel. Но столкнулись с некоторыми ошибками
import pandas
...
...
response = requests.get(BASE_URL, headers=headers)
#print(response.text)
df_json = json.loads(response.text)
print(df_json) -- this is printing json as string
df = pd.read_json(df_json)
-- now i want to load this into excel
df.to_excel('c:\scripts\DATAFILE.xls', sheet_name='Sheet1', index=False, engine='xlsxwriter')
Ошибка:
ValueError: Invalid file path or buffer object type: <class 'dict'>
может кто-нибудь помочь, пожалуйста