2

'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.

Windstorm1981
  • 2,564
  • 7
  • 29
  • 57
  • Are you asking how to infer/create the pandas DateOffset from an existing datetime index? – luca Apr 20 '18 at 09:32

0 Answers0