Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a dataset that I import from salesforce. I wrote a python script that starts with a loop through the ID column and changes it to a list of strings.
The code:
FRID_list = dataset['FRID_c'].tolist()
FRID_listn = [str(z) for z in FRID_list]
So if I export the dataset to a csv, I can loop through, but when I try to run it through power query it says it doesn't recognize the column name (FRID_c).
Solved! Go to Solution.
Nevermind, I figured it out. It was a typing error. I didn't realize the dataset had "FRID__c" as opposed to "FRID_c". I just had to have two underscores. Thanks for the help anyway.
Hi @Anonymous
What's your purpose of this code?
FRID_list = dataset['FRID_c'].tolist() FRID_listn = [str(z) for z in FRID_list]
"So if I export the dataset to a csv, I can loop through"
Do you use the pythond code to export dataset to csv?
"when I try to run it through power query"
Do you mean Using Python in Query Editor
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The purpose of my code is to web scrape. I loop through the ID's and look them up on our company site. The rest of the code works fine, I just can't reference the dataset as a dataframe to move that column to a list.
Yes, I used the python code to create a dataframe using the CSV version of the dataset. But I need the same code to work in the power query editor using the dataset that I am running the python in. So I go to Edit Queries>Transform>Run Python Code. I try to reference the dataset as a dataframe and it will not recognize the column name.
Nevermind, I figured it out. It was a typing error. I didn't realize the dataset had "FRID__c" as opposed to "FRID_c". I just had to have two underscores. Thanks for the help anyway.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.