使用tushare 库查阅交易日历

资料参考:https://tushare.pro/

交易日历

接口:trade_cal
描述:获取各大交易所交易日历数据,默认提取的是上交所

tushare的版本和更新:

执行命令:
pip install tushare --upgrade
或者参考安装步骤,覆盖老版本。
#查看版本
import tushare
print(tushare.__version__)

旧版函数:

import tushare as ts
ts.trade_cal()

新版函数:

import tushare as ts
pro = ts.pro_api()
pro.query('trade_cal') 

发现:

测试日期:2020-01-08

tushare官网显示:交易日历定时更新。

但从输出可见,在相同版本和默认参数条件下,旧版函数和新版函数的输出不相同,交易日历没有同时更新,使用中需要注意一下使用最新函数。

猜你喜欢

转载自www.cnblogs.com/JuliaZhao/p/12165291.html