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

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.

Reply
LauraBueno
Helper III
Helper III

Running Python Scripts from Power BI

Hi, 

 

I'm trying to run the example below from Power Bi, however I'm getting the following error: 

 

import pandas as pd

data = [['Alex',10],['Bob',12],['Clarke',13]]

df = pd.DataFrame(data,columns=['Name','Age'],dtype=float)

print (df)

 

scriptPBI.png

 

 

Can anyone help please? I have the python scripting enabled in Power BI and packages installed

 

thanks!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@LauraBueno , Reinstall numpy. make sure you use PIP install

check the description of this video for various command and error solution links

https://www.youtube.com/watch?v=5D0BkNsu5CM

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@LauraBueno , Reinstall numpy. make sure you use PIP install

check the description of this video for various command and error solution links

https://www.youtube.com/watch?v=5D0BkNsu5CM

Hi @amitchandak ,

 

I'm now trying to create a scatter plot with python for two numeric arrays: Experimental and Predicted as shown below. 

 

datapyplot.png

However I get the following error:

 

PyPLoterror.png

 

 

Any help would be really appreciated! 

Thank you

@amitchandak Thanks a lot! that worked! 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.