0

'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

spartanboy
  • 44
  • 11

1 Answers1

1

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

Le_Tasse
  • 11
  • 3
  • I have anaconda installed in another location: C:\Users\abc\Anaconda3 'm using this directory for power bi setting. It should be able to run the script, but getting an error Now, the pandas is located under 2 locations: 1. C:\Users\abc\Anaconda3\Lib\site-packages 2. C:\Users\abc\Anaconda3\Lib\site-packages\astropy\io\misc – spartanboy Jan 11 '23 at 21:33
  • please review original post. Yes, I have pandas installed – spartanboy Jan 11 '23 at 21:51