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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Mani1205
Helper II
Helper II

print function in python to collect the variables in power bi

Hi Team,

 

I am trying to the print the mean median mode , skewness and kurtosis using python in power bi 

when i use print in the py script editor it throws error.. please advice best way to summariaze data like below 

 

print("Mean : %f\nMedian : %f"%(Loop_Time.mean(),Loop_Time.median()))
print("Variance : %f\nStandar Deviation: %f"%(Loop_Time.var(),Loop_Time.std()))
print("Skewness : %f"%(Loop_Time.skew()))
print("Kurtosis : %f"%(Loop_Time.kurtosis()))

#Finding min,max,1st,3rd quartile and median
print("Min :%f"%(Loop_Time.min()))
print("1st Quartile :%f"%(Loop_Time.quantile(0.25)))
print("Meidan :%f"%(Loop_Time.median()))
print("3rd Quartile :%f"%(Loop_Time.quantile(0.75)))
print("Max :%f"%(Loop_Time.max()))

 

 

Mani1205_0-1622481183216.png

 

 

1 ACCEPTED SOLUTION
Mani1205
Helper II
Helper II

Team i found a workarround for this...

 

Here is the example how i did it in script editor 

 

import matplotlib.patheffects as path_effects
import pandas as pandas
import matplotlib.pyplot as plt

Loop_Time=dataset.Loop_Time

a='Mean :'+str(round(Loop_Time.mean(),3))
b='variance :'+str(round(Loop_Time.var(),3))

text = plt.text(0.5, 0.5,a,fontsize=20)
text1 = plt.text(0.5, 0.4,b,fontsize=20)
plt.axis('off')
plt.show()
 
Mani1205_0-1622525993104.png

 

View solution in original post

1 REPLY 1
Mani1205
Helper II
Helper II

Team i found a workarround for this...

 

Here is the example how i did it in script editor 

 

import matplotlib.patheffects as path_effects
import pandas as pandas
import matplotlib.pyplot as plt

Loop_Time=dataset.Loop_Time

a='Mean :'+str(round(Loop_Time.mean(),3))
b='variance :'+str(round(Loop_Time.var(),3))

text = plt.text(0.5, 0.5,a,fontsize=20)
text1 = plt.text(0.5, 0.4,b,fontsize=20)
plt.axis('off')
plt.show()
 
Mani1205_0-1622525993104.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.