I am trying to read in the JSON structure below into pandas dataframe, but it throws out the error message:
ValueError: Mixing dicts with non-Series may
If you need only the result part in the data frame, here is the code to help you:
import json
import pandas as pd
data = json.load(open('json_file.json'))
df = pd.DataFrame(data["result"])
To the best of my knowledge, the ValueError occurs because the data types are all over the place, some strings, some lists, multiple {} etc. This error may be solved by normalizing the data. To do that, here is the code below:
import json
with open('json_file.json') as project_file:
data = json.load(project_file)
df = pd.json_normalize(data)