特牛网址导航

【Python量化交易】pandas中shift(1)的用法_df['open'] / df['close'].shift(1)-CSDN博客

网友收藏
文章浏览阅读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)