Forum Discussion
Nivedhana
2 years agoHelper 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?
Any idea how we can improve the performance please?
1 Reply
- SaiTejaTalasilaSuper User
Hi Nivedhana,
You can refer this one -
https://www.quicklylearnpowerbi.com/blog/power-bi-python-visuals-why-are-they-slow