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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Pandas is not recognized.

When running the script the visual displays "Can't display this visual. See details"

I click it and it says:

Python script error.

<pi> File "PythonScriptWrapper.PY", line 18

  dataset = pd.DataFrame(DT , DT Code)

                           ^

SyntaxError: invalid syntax

</pi>

 

I have the following code. 

 

1 # The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your  script:

2 import pandas as pd

3 dataset = pd.DataFrame(DT , DT Code)

4 # dataset = dataset.drop_duplicates()

5 import matplotlib.pyplot as plt

6 dataset.plot(kind='bar',x='DT)',y='DT')

7 plt.show()

 

Lines 1,3,4 are auto generated when I click and drag my data into the python visual. I impetrated pandas to try and fix the issue i have

I plot DT vs DT since I know they are the same length and that way I know there is not a plotting error. 

 

I have pandas, numpy, and matplot lib installed and have even referenced my script to a new env instead of my root python to try to get it to work. I am using python 3.8. 

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Which version of the Pandas package are you using?

 

Regards,
Community Support Team _ Jing

Anonymous
Not applicable

Hey @v-jingzhang ,

 

I am using pandas version 1.0.5

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors