My json string:
{ "status":1,"data":{"users":[{"id":"5948690","name":"David William","shifts":[{"id":"4538","schedule":"8190","schedule_name":"Agenting","schedule_color":"1"}],"total":40,"reports":{"479":[{"id":"4538","schedule":"8190","schedule_name":"Agent","schedule_color":"00A464"}]}}],"dates":[{"id":479,"formatted":"Sep 6, 2022","total":381}],"needs_publish":144,"needs_republish":125,"total":3850},"metadata":[],"token":"ec0a864","error":null}
Using Python I am trying to get the following ouput in excel:

Link of online tool for converting json to excel: https://products.aspose.app/cells/conversion/json-to-xlsx
In Jupyter I have tried this:
import json
with open("E:/TP/json_to_csv/json_data.json", "r") as read_file:
data = json.load(read_file)
print(data)
print(type(data))
df = pd.DataFrame.from_dict(data)
df
But I am getting this error:
ValueError: Mixing dicts with non-Series may lead to ambiguous ordering.
I have also tried this code:
import json
import pandas as pd
with open('E:/TP/json_to_csv/json_data.json', 'r') as f:
data = json.load(f)
df1=pd.json_normalize(data['data'])
dfu=df1.explode('users')
shift=pd.DataFrame(dfu['users'].apply(pd.Series))
t=shift.explode('shifts')
t.to_csv('E:/TP/json_to_csv2.csv')
How do I proceed further? I am stuck. Any help is appreciated :)
