The Shapiro Wilk test can be used, and the ready-made wheels in SciPy can be used directly. The code is as follows:
>>> from scipy import stats
>>> import numpy as np
>>> np.random.seed(12345678)
>>> x = stats.norm.rvs(loc=5, scale=3, size=100)
>>> shapiro_test = stats.shapiro(x)
>>> shapiro_test
ShapiroResult(statistic=0.9772805571556091, pvalue=0.08144091814756393)
>>> shapiro_test.statistic
0.9772805571556091
>>> shapiro_test.pvalue
0.08144091814756393
The zero hypothesis of Shapiro Wilke test is that the data obey normal distribution, and the zero hypothesis can be overturned when the pvalue is small. Although the pvalue in the above code is small, it is still larger than 0.05, so it can be considered that the data is subject to normal distribution.
see also
scipy.stats.shapiro
Read More:
- import org.junit.Test And @ test error reporting — solutions
- Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test)
- Running Python 3.7 web.py Runtimeerror: generator raised stopiteration exception occurred during test
- Maven skip unit test- maven.test.skip And skipstests
- Go test print no output
- The cause, discrimination, test and solution of Multicollinearity
- Troubleshooting of Jenkins upgrade to 2.42 JUnit test report
- Maven skip unit test
- Failed to retrieve platformtransactionmanager for @ transactional test: [defaulttest]
- UOS LTP compilation ustat test item error
- [Solved] Unit test automatically injects error reporting nullpointer
- Causes and solutions of nm test o file format not recognized
- Solve the problem of springboot and unit test starting applicationrunner
- Self test error when springboot accesses es and starts
- The usage of Java JUnit unit test and the solution of initialization error
- Attributeerror: ‘STR’ object has no attribute ‘decode’ solution: the pro test is successful.
- Error in react build packaging test environment
- The springboot test class reported an error NullPointerException
- RuntimeError: CUDA error: out of memory solution (valid for pro-test)
- CentOS Basic XLib functionality test failed!