Skip to content

Instantly share code, notes, and snippets.

Created November 9, 2020 10:48
What would you like to do?
3 ways to do test of normality with Scipy library in Python
from scipy import stats
c = stats.shapiro(a)
d = stats.shapiro(b)
print('W statistic is {0} and p-value is {1}'.format(c[0], c[1]))
W statistic is 0.998044490814209 and p-value is 0.301758736371994
# can't reject the null hypothesis, it is likely normally distributed
print('W statistic is {0} and p-value is {1}'.format(d[0], d[1]))
W statistic is 0.9490579962730408 and p-value is 4.253243595739461e-18
# can reject the null hypothesis, this should not be the normal distribution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment