Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Dataset used as a pandas DataFrame in a power query

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).

 

image.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

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.

Anonymous
Not applicable

@v-juanli-msft 

 

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.

Anonymous
Not applicable

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.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors