Pandas Custom Business Day Calendar Offset

99封情书 提交于 2019-12-24 11:10:03

问题


'This is a basic question that I can't seem to find addressed anywhere.

I understand how to make a custom business day calendar per the pandas documentation.

However, I have a datetime index that is already created and is 'customized'. It is a date range with particular dates eliminated:

custom_datelist:

2003-01-02
2003-01-03
2003-01-05
2003-01-06
2003-01-09
...

So, with this calendar, how do I create a date offset? The documentation indicates how to generate the date series but it isn't clear about the offset in this case. Would my offset simply be:

pd.to_datetime('2003-01-06') + 1*custom_datelist

give me pd.to_datetime('2003-01-09')?

Thanks.

来源:https://stackoverflow.com/questions/48737245/pandas-custom-business-day-calendar-offset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!