In [1]:
import numpy as np
import pandas as pd
In [2]:
NR=pd.read_excel("F:/2019 GB Python/Normality.xlsx")
In [3]:
NR.head()
Out[3]:
Normal NonNormal
0 28.686942 0.627870
1 30.811276 50.558054
2 28.477675 54.593256
3 31.689752 19.613195
4 31.132768 48.658675
In [6]:
NR.shape
Out[6]:
(1000, 2)
In [7]:
from scipy import stats
In [8]:
stats.normaltest(NR.Normal).pvalue
Out[8]:
0.7483542172965185
In [9]:
stats.normaltest(NR.NonNormal).pvalue
Out[9]:
1.2849743839690619e-74
In [10]:
from scipy.stats import anderson
In [19]:
anderson(NR.Normal)
Out[19]:
AndersonResult(statistic=0.268501119607663, critical_values=array([0.574, 0.653, 0.784, 0.914, 1.088]), significance_level=array([15. , 10. ,  5. ,  2.5,  1. ]))
In [20]:
from statsmodels.graphics.gofplots import qqplot
In [21]:
from matplotlib import pyplot
In [22]:
qqplot(NR.Normal, line ='s')
pyplot.show()
In [23]:
qqplot(NR.NonNormal, line ='s')
pyplot.show()
In [ ]: