(Aug-12-2022, 09:11 AM)Larz60+ Wrote: Try:
import pandas as pd import os from pathlib import Path jpath = Path('C://JsonFiles//') filelist = [filename for filename in jpath.iterdir() if filename.is_file() and filename.suffix == '.json'] df = pd.DataFrame([pd.read_json(file, typ="series") for file in filelist]) print(df)
Thanks Larz, but it does not work what I am expecting. If you look at my json files and review my code, I am trying to load those into one single dataframe with correct column names (I have attached one more screen with the data frame columns). json_normalize function and meta columns are used to extract the data hierarchical data from the Json.
My code works fine but it does not load all the given file's data in DF , only loads last one. Kindly please help to twick my code so that all files loaded in one DF.