Forum Discussion
Create multiple Tables from Python
- Anonymous4 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}"])
Not sure what you mean...it's the loading them to Power BI part that I have a problem with...
I can only see one table in Power Query, I want to have a list of all the tables representing the files that are in the GCS Bucket...
Hi Anonymous ,
Sorry for the misunderstanding.
Are the python statements full?Have you defined "blobs" first?
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
- Anonymous4 years agoNot applicable
Yes 'blobs' is defined first....I didn't post all the python....
Like I said, it works fine in PyCharm in that it prints each file name and then the contents.
But when I use this script in Power Query I just get a table for the last iteration of the loop...I would like to see a table for each of the three files in GCS if that's possible?
- v-kelly-msft4 years ago
Community Support
Hi Anonymous ,
Try to use Python IDE with Power bi,check below reference:
https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-python-ide
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!
- Anonymous4 years agoNot applicable
Thanks but I don't see what dfference that would make? I am using a Python IDE. I'm not using the Python visual, I'm using the Python Data Connector which doesn't have any interaction with a specified external IDE:
A bit like in this doc:
https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-python-scripts
- Syndicate_Admin4 years ago
Administrator
Yes 'blobs' is defined first....I didn't post all the python....
Like I said, it works fine in PyCharm in that it prints each file name and then the contents.
But when I use this script in Power Query I just get a table for the last iteration of the loop...I would like to see a table for each of the three files in GCS if that's possible?