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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ellen3333
Regular Visitor

Python visual (seaborn box plot) get error message: Could not interpret input

I want to create a python visual by using the following script but got an error message: could not interpret input "BaseRank."
Anyone can help me to explain what is the root cause and how to solve it? Thanks!

 

# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script:
# dataset = pandas.DataFrame(BaseRank, Gender, Time1stPromo)
# dataset = dataset.drop_duplicates()

# Paste or type your script code here:
from matplotlib import pyplot as plt
import seaborn as sns

fig= plt.figure(figsize=(12,3))
_genders= ['F', 'M']
sns.boxplot(x="BaseRank", y="Time1stPromo", hue="Gender", hue_order=_genders, dataset=dataset, palette="Set1")
plt.show
 
3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @ellen3333 

 

Based on the error message, it seems that the python interpreter can't recognize the input 'BaseRank'. I'd like to suggest you check if there is something wrong with 'BaseRank'. About how to create Power BI visuals by using python, you may refer to the document .

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Unfortunatly, I don't understand your language. Is it possible that you can write in English? Thanks.

The BaseRank is like "6-Associate", what is wrong with this?

Thanks,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.