scipy stats.skew() | Python Last Updated : 11 Feb, 2019 Comments Improve Suggest changes Like Article Like Report scipy.stats.skew(array, axis=0, bias=True) function calculates the skewness of the data set. skewness = 0 : normally distributed. skewness > 0 : more weight in the left tail of the distribution. skewness < 0 : more weight in the right tail of the distribution. Its formula - Parameters : array : Input array or object having the elements. axis : Axis along which the skewness value is to be measured. By default axis = 0. bias : Bool; calculations are corrected for statistical bias, if set to False. Returns : Skewness value of the data set, along the axis. Code #1: Python3 # Graph using numpy.linspace() # finding Skewness from scipy.stats import skew import numpy as np import pylab as p x1 = np.linspace( -5, 5, 1000 ) y1 = 1./(np.sqrt(2.*np.pi)) * np.exp( -.5*(x1)**2 ) p.plot(x1, y1, '*') print( '\nSkewness for data : ', skew(y1)) Output : Skewness for data : 1.1108237139164436 Code #2: Python3 # Graph using numpy.linspace() # finding Skewness from scipy.stats import skew import numpy as np import pylab as p x1 = np.linspace( -5, 12, 1000 ) y1 = 1./(np.sqrt(2.*np.pi)) * np.exp( -.5*(x1)**2 ) p.plot(x1, y1, '.') print( '\nSkewness for data : ', skew(y1)) Output : Skewness for data : 1.917677776148478 Code #3: On Random data Python3 1== # finding Skewness from scipy.stats import skew import numpy as np # random values based on a normal distribution x = np.random.normal(0, 2, 10000) print ("X : \n", x) print('\nSkewness for data : ', skew(x)) Output : X : [ 0.03255323 -6.18574775 -0.58430139 ... 3.22112446 1.16543279 0.84083317] Skewness for data : 0.03248837584866293 Comment More infoAdvertise with us Next Article scipy stats.skew() | Python V vishal3096 Follow Improve Article Tags : Python Python-scipy Python scipy-stats-functions Practice Tags : python Similar Reads scipy stats.f() | Python scipy.stats.f() is an F continuous random variable that is defined with a standard format and some shape parameters to complete its specification. Parameters : q : lower and upper tail probability a, b : shape parameters x : quantiles loc : [optional] location parameter. Default = 0 scale : [optiona 2 min read scipy stats.chi() | Python scipy.stats.chi() is an chi continuous random variable that is defined with a standard format and some shape parameters to complete its specification. Parameters : q : lower and upper tail probability x : quantiles loc : [optional] location parameter. Default = 0 scale : [optional] scale parameter. 2 min read scipy stats.skewtest() function | Python scipy.stats.skewtest(array, axis=0) function test whether the skew is different from the normal distribution. This function tests the null hypothesis that the skewness of the population that the sample was drawn from is the same as that of a corresponding normal distribution. Its formula - Parameter 1 min read scipy.stats.chi2() | Python scipy.stats.chi2() is an chi square continuous random variable that is defined with a standard format and some shape parameters to complete its specification. Parameters : q : lower and upper tail probability x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale param 2 min read scipy stats.fisk() | Python scipy.stats.fisk() is an fisk continuous random variable. It is also known as the log-logistic distribution, and equals the Burr distribution with d == 1 and is defined with a standard format and some shape parameters to complete its specification. Parameters : q : lower and upper tail probability x 2 min read Like