I've created a custom Calendar:
holidays_list = [...] # list of all weekends and holidays for needed time period
class MyBusinessCalendar(AbstractHolidayCalendar):
start_date = datetime(2011, 1, 1)
end_date = datetime(2017, 12, 31)
rules = [
Holiday(name='Day Off', year=d.year, month=d.month, day=d.day) for d in holidays_list
]
cal = MyBusinessCalendar()
I know that salary days are the 5th and the 20th days of each month or the previous business days if these ones are days off. Therefore I take
bus_day = CustomBusinessDay(calendar=cal)
r = pd.date_range('2011-01-01', '2017-12-31', freq=bus_day)
and I'd like to compute for each day from r if it's a salary day. How can I get this?