Hello,
I would like some help, please.
I understood how to add and read a single file in the project (-> add to project -> data), but I don't know how to do it for multiple files.
I am trying to export a project from a Jupiter notebook. For this, it is necessary to read several json files from a folder in a sequential matter in order to create a single dataframe. At the moment I do this:
# LOAD JSON FILESdir_path = "/User/Desktop//Dataset/Snapshots"# Open Filesfnames = sorted([fname for fname in os.listdir(dir_path) if fname.startswith('Snapshot')])dfs = []for fname in fnames : filename = os.path.join(dir_path, fname) with open(filename, 'r') as myfile: data = myfile.read() if data[-1] != ']': data = data + ']' # Parse File obj = json.loads(data) # Convert into Pandas DataFrame dfs.append(json_normalize(obj, ))# Build a Single DataFrame from all individual DataFramesdata = pd.concat(dfs)data.reset_index(inplace=True, drop=True)Can you please help me in how to store this folder containing multiple json files in the project and how to do it to read it?
Many thanks in advance!
------------------------------
Jéssica
------------------------------
#WatsonStudio