Big Data: Convert nested JSON files to data frame and CSV in python

Shivika K Bisen
Bright AI
Published in
Oct 14, 2022

Step1: Iterate through multiple JSON files using glob.glob(*.json)

Step 2: Read the nested JSON file as line

Step 3: Flatten JSON to df using pd.json_normalize

Step 4: Create subset df (data frame) by taking only relevant columns from nested JSON and replacing it as df

Step 5: Append all the df (flattened JSON) into one dfsand concatenate it as df_combine

Step:

--

--

Shivika K Bisen
Bright AI

Gen AI/ML, Data Scientist | University of Michigan Alum | Generative AI, Recommendation & Search & NLP, Predictive models. https://sbisen.github.io/