spartanboy
spartanboy

Reputation: 56

Error while running python script in power bi desktop

'm trying to use python scripting in power bi. I am referring documentation: here and here;

also confirming of installing appropriate packages in the folder, enter image description here

Identifying directory using where python and my installation directory is C:\USERS\ABC\ANACONDA3

enter image description here

I am using an example script provided here

    import pandas as pd 
df = pd.DataFrame({ 
    'Fname':['Harry','Sally','Paul','Abe','June','Mike','Tom'], 
    'Age':[21,34,42,18,24,80,22], 
    'Weight': [180, 130, 200, 140, 176, 142, 210], 
    'Gender':['M','F','M','M','F','M','M'], 
    'State':['Washington','Oregon','California','Washington','Nevada','Texas','Nevada'],
    'Children':[4,1,2,3,0,2,0],
    'Pets':[3,2,2,5,0,1,5] 
}) 
print (df)

Please help in resolving below error, enter image description here enter image description here enter image description here

Upvotes: 0

Views: 259

Answers (1)

Le_Tasse
Le_Tasse

Reputation: 11

Looks like you don't have panda installed.

You could first check in your C:\Users\abc\AppData\Local\Programs\Python\Python39\Lib\site-packages that you indeed have the panda package available.

If not, you can install it using this command : py -m pip install pandas

Upvotes: 1

Related Questions