I\'m trying to create a Trading calendar using Pandas. I\'m able to create a cal instance based on the USFederalHolidayCalendar. The USFederalHolidayCalendar is not consiste
You have to create new instance of class: cal1 = tradingCal(). This works for me.
from pandas.tseries.holiday import get_calendar, HolidayCalendarFactory, GoodFriday
from datetime import datetime
cal = get_calendar('USFederalHolidayCalendar') # Create calendar instance
cal.rules.pop(7) # Remove Veteran's Day rule
cal.rules.pop(6) # Remove Columbus Day rule
tradingCal = HolidayCalendarFactory('TradingCalendar', cal, GoodFriday)
print tradingCal.rules
#new instance of class
cal1 = tradingCal()
print cal1.holidays(datetime(2014, 12, 31), datetime(2016, 12, 31))
#DatetimeIndex(['2015-01-01', '2015-01-19', '2015-02-16', '2015-04-03',
# '2015-05-25', '2015-07-03', '2015-09-07', '2015-11-26',
# '2015-12-25', '2016-01-01', '2016-01-18', '2016-02-15',
# '2016-03-25', '2016-05-30', '2016-07-04', '2016-09-05',
# '2016-11-24', '2016-12-26'],
# dtype='datetime64[ns]', freq=None, tz=None)