Hi All
I need your guidance :
I have three Jason files which in my local drive which need to be loaded in one data frame so that I can do the further exploratory data analysis. I have written a code but this only loads last file in the data frame . Kindly please find the below code for reference.
I have also attached the Json files and notebook code screen shot.
I need your guidance :
I have three Jason files which in my local drive which need to be loaded in one data frame so that I can do the further exploratory data analysis. I have written a code but this only loads last file in the data frame . Kindly please find the below code for reference.
I have also attached the Json files and notebook code screen shot.
import json import pandas as pd import os path_to_json ='C://JsonFiles//' def file_path(path_to_json): json_files = [path_to_json + pos_json for pos_json in os.listdir(path_to_json) if pos_json.endswith('.json')] return json_files for jf in file_path(path_to_json): with open(jf,'r') as f: data = json.loads(f.read()) # Flatten data df_nested_list = pd.json_normalize( data, record_path =['attributes'], meta=['ORDERNUMBER', 'PRODUCTCODE']) df_nested_list
Attached Files