pandas.tseries.holiday.AbstractHolidayCalendar.merge#

AbstractHolidayCalendar.merge(other, inplace=False)[source]#

Merge holiday calendars together.

The caller’s class rules take precedence. The merge will be done based on each holiday’s name.

Parameters:
otherholiday calendar

Calendar, instance/subclass, or array of Holiday objects to merge into this calendar’s rules.

inplacebool (default=False)

If True set rule_table to holidays, else return array of Holidays.

Returns:
list of Holiday or None

The combined list of holidays if inplace is False, otherwise None.

See also

tseries.holiday.AbstractHolidayCalendar.merge_class

Merge holiday calendars together.

Examples

>>> from pandas.tseries.holiday import (
...     AbstractHolidayCalendar,
...     USLaborDay,
...     USMemorialDay,
... )
>>> class Calendar1(AbstractHolidayCalendar):
...     rules = [USMemorialDay]
>>> class Calendar2(AbstractHolidayCalendar):
...     rules = [USLaborDay]
>>> merged = Calendar1().merge(Calendar2())
>>> [holiday.name for holiday in merged]
['Labor Day', 'Memorial Day']