Skip to content

Instantly share code, notes, and snippets.

@yuyasugano
Created November 9, 2020 11:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuyasugano/53ef78f2ca08b7b20a63b2a7442ca67b to your computer and use it in GitHub Desktop.
Save yuyasugano/53ef78f2ca08b7b20a63b2a7442ca67b to your computer and use it in GitHub Desktop.
3 ways to do test of normality with Scipy library in Python
from scipy import stats
print('Skewness is {0} and Kurtosis is {1}'.format(stats.skew(a), stats.kurtosis(a, fisher=False)))
Skewness is 0.07652272048424928 and Kurtosis is 2.772732673807923
print('Skewness is {0} and Kurtosis is {1}'.format(stats.skew(b), stats.kurtosis(b, fisher=False)))
Skewness is -0.03504745242988745 and Kurtosis is 1.7525462915557393
stats.describe(a)
DescribeResult(nobs=1000, minmax=(-2.8249022278040115, 3.0569511100204605), mean=-0.053648592943343135,
variance=0.9768884437369372, skewness=0.07652272048424928, kurtosis=-0.2272673261920768)
stats.describe(b)
DescribeResult(nobs=1000, minmax=(0.0014476014617077482, 0.9994611290735824), mean=0.5146672975323227,
variance=0.08516184045136042, skewness=-0.03504745242988745, kurtosis=-1.2474537084442607)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment