3 ways to do test of normality with Scipy library in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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