十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
我就废话不多说了,直接上代码吧!
创新互联成都网站建设按需定制,是成都网站营销公司,为成都混凝土搅拌站提供网站建设服务,有成熟的网站定制合作流程,提供网站定制设计服务:原型图制作、网站创意设计、前端HTML5制作、后台程序开发等。成都网站建设热线:13518219792# -*- coding: utf-8 -*- """ Created on Thu Jun 22 17:03:16 2017 @author: yunjinqi E-mail:yunjinqi@qq.com Differentiate yourself in the world from anyone else. """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import statsmodels.tsa.stattools as ts import statsmodels.api as sm from statsmodels.graphics.api import qqplot from statsmodels.sandbox.stats.runs import runstest_1samp import scipy.stats as sts namelist=['cu','al','zn','pb','sn','au','ag','rb','hc','bu','ru','m9','y9','a9', 'p9','c9','cs','jd','l9','v9','pp','j9','jm','i9','sr','cf', 'zc','fg','ta','ma','oi','rm','sm'] j=0 for i in namelist: filename='C:/Users/HXWD/Desktop/数据/'+i+'.csv' data=pd.read_csv(filename,encoding='gbk') data.columns=['date','open','high','low','close','amt','opi'] data.head() data=np.log(data['close']) r=data-data.shift(1) r=r.dropna() #print(r) rate = np.array(list(r)) print('品种{}数据长度{}均值{}标准差{}方差{}偏度{}峰度{}'.format(i,len(rate), rate.mean(),rate.std(),rate.var(),sts.skew(rate), sts.kurtosis(rate)))