cn_stock_holidays
cn_stock_holidays copied to clipboard
Zipline AssertionError
您好,能否告知,一般如果出现这种错误,是数据源的问题还是日历的问题? AssertionError: Got 382 rows for daily bars table with first day=2016-08-09, last day=2018-03-07, expected 383 rows. Missing sessions: [Timestamp('2016-10-31 00:00:00+0000', tz='UTC'), Timestamp('2016-11-01 00:00:00+0000', tz='UTC')] Extra sessions: [Timestamp('2017-02-02 00:00:00+0000', tz='UTC')]
一般是ingest用的数据和日历里面的交易日没有完全匹配,zipline对这个限制比较严格
数据问题, 2016-10-31 和 2016-11-01 是交易日。 试着补上空行 df_i.add(df_i.reindex(['2016-10-31']))