大家好!
我要使用Tushare查询金融数据,以下是查询股票行情的代码:
df = ts.pro_bar(ts_code='000001.SZ', adj='qfq', start_date='20180101', end_date='20181011')
我要将end_date的数值自动更改为start_date之后的第20个交易日
请问代码应该如何改写?谢谢!
瞅瞅
https://zhuanlan.zhihu.com/p/461500036
如果你只是要单纯通过跳过周末来判断交易日就用timedelta自己写个方法就好
https://docs.python.org/zh-cn/3.10/library/datetime.html
当然个人觉得你可以通过判断下一天有没有数据来判断他是不是交易日,然后往后数二十天