Can someone help me out with the following:
I have a folder that contains levels of sub folders, which each contain several json files. I have been using the following code to extract them all and join them into a dataframe:
PATH = ("C:/Users/77901898/Documents/.../11 - Trial run")
EXT = ("*.json")
json_files = []
for path, subdir, files in os.walk(PATH):
for file in glob(os.path.join(path, EXT)):
json_files.append(file)
df = pd.concat([pd.read_json (file) for file in json_files], ignore_index = True)
But I am getting the following error: "If using all scalar values, you must pass an index"
I have also tried the implementation from this question: How to read multiple json files into pandas dataframe? but it throws up "ValueError: No objects to concatenate"