数据采集20200628(检验正态分布)

#检验正态分布

EDate=”20200624″

from scipy.stats import kstest

from scipy.stats import shapiro

from scipy.stats import normaltest

data=DataAPI.MktIdxdGet(indexID=u””,ticker=u”000001″,tradeDate=u””,beginDate=u”20000101″,endDate=EDate,

exchangeCD=u”XSHE,XSHG”,field=u”closeIndex”,pandas=”1″)

d={‘mean’:([np.mean(data.closeIndex)]),’median’:([np.median(data.closeIndex)]),’std’:([np.std(data.closeIndex)])}

jg=pd.DataFrame(d)

data1=[1,1,1,3,2,0,0,0,0,0,0,2]

data1

data2=data.values.tolist()

data2

#mean=jg[‘mean’]

#std=jg[‘std’]

kstest(data2,’norm’)

#shapiro(data2)

#normaltest(data1,axis=0,nan_policy=’propagate’)

 

KstestResult(statistic=1.0, pvalue=0.0)

Leave a Reply

邮箱地址不会被公开。 必填项已用*标注