时间序列分析(1)Python-计算简单收益率

来源:互联网 发布:sql分页查询语句limit 编辑:程序博客网 时间:2024/04/29 21:25
# -*- coding: utf-8 -*-"""Created on Fri Feb 17 11:30:57 2017@author: yunjinqiE-mail:yunjinqi@qq.comDifferentiate yourself in the world from anyone else."""import pandas as pddf=pd.read_excel('luowen.xls')df.head()df=df.iloc[::,8]df.head()df.shift(1).head()rate=(df-df.shift(1))/df.shift(1)rate=rate.dropna()rate.head()

#总体上感觉用Python比用R简单一点点。

这将是一个序列课程,将会分享R语言、Python时间序列分析的方法。主要参考R语言相关的时间序列书籍,一点点学习,并使用到Python上面。

0 0
原创粉丝点击