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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Nivedhana
Helper I
Helper I

Python scripts visuals taking more than 30secs to load in power BI

We have a power BI containing 3 python visuals. All visuals almost same script with different parameters. These visuals take about 30 secs to load. 

The script - 

import matplotlib.pyplot as plt
import seaborn as sns
import scipy
from scipy.optimize import curve_fit

p=sns.regplot(data=dataset,x='SPEED OVER GROUND',y='AVERAGE ME POWER',order=2,color='#D24545',label="Power(Logs)")
r=sns.regplot(data=dataset,x='SPEED OVER GROUND',y='Power (Kw)',order=2,color='#2D9596',label="Power(Nominal Properller Curve")
plt.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc=3,ncol=2, mode="expand", borderaxespad=0.)
slope,intercept,r,p,sterr = scipy.stats.linregress(x=p.get_lines()[0].get_xdata(), y =p.get_lines()[0].get_ydata())
plt.text(20,3000, "$r^2$ = " + str(round(r,3)))


plt.show()

Any idea how we can improve the performance please?
1 REPLY 1
SaiTejaTalasila
Super User
Super User

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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