- 链接地址:https://blog.csdn.net/CSDN_fzs/article/details/102496332
- 链接标题:【Python量化交易】pandas中shift(1)的用法_df['open'] / df['close'].shift(1)-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:9672
文章浏览阅读1.2w次,点赞5次,收藏37次。import pandas as pdimport tushare as tsdata = ts.get_hist_data('601688', '2017-06-01')#用tushare获取行情data = data.sort()#对数据进行排序df = pd.DataFrame()#创建一个新的DataFramedf['close'] = data['close'] # 新Da..._df['open'] / df['close'].shift(1)
版权声明:本文发布于特牛网址导航 内容均来源于互联网 如有侵权联系删除