How to extract information from multiple json files using python

Viewed 288

I have multiple json files in a folder. I had implemented a way to catch only .json files in this folder. My problem is: I need to extract some information contained in each of those files but it didn't work the way I expected. I need to find a way to get this information and convert all into a pandas dataframe.

The variable jsons_data contains all .json files

jsons_data = json_import(path_to_json)

for index, js in enumerate(jsons_data):
    with open(os.path.join(path_to_json, js)) as json_file:
        data = json.loads(json_file)

print(data)
1 Answers
Related