Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Create multiple Tables from Python

Hi,   Using Python I'm connecting to Google Cloud Storage, I want to be able to loop through the various files in a bucket, create pandas dataframes for each one and then use the contents in Power ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi,

     

    I'm not sure is this thread still relevant. I had the same issue and I solved this by associating each data frame to a unique global variable:

     

    for file in blobs:
        file_path = "...."
        with fs.open(file_path) as f:
            globals()[f"{file.name}"] = pd.read_csv(f)
            print(globals()[f"{file.name}"])