1

My system is python3.6, with numpy 1.16.2,scipy 1.2.1,matplotlib 3.0.3

import numpy
import matplotlib
import scipy.stats
a=numpy.arange(2,44,1)
print(scipy.stats.shapiro(a))
matplotlib.pyplot.hist(a)

Above script output as below:

(0.9560521245002747, 0.10655178874731064)

Untitled2.png

Obviously,a is not normal distributed,but scipy.stats.shapiro(a)'s p-value is 0.10655178874731064
How can I accept this result?

What's the problem?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
kittygirl
  • 2,255
  • 5
  • 24
  • 52
  • 1
    FYI: The [R](https://www.r-project.org/) function [`shapiro.test`](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/shapiro.test.html) returns the same values (where "the same" means the first five significant digits agree). – Warren Weckesser Mar 26 '19 at 04:04
  • 1
    You might be interested in [this answer to a question about testing for normality](https://stackoverflow.com/questions/7781798/seeing-if-data-is-normally-distributed-in-r/7788452#7788452). – Warren Weckesser Mar 26 '19 at 04:12
  • @WarrenWeckesser,then, what method can be used to detect normal distribution? – kittygirl Mar 26 '19 at 06:31

0 Answers0