Calendar.split#
- Calendar.split(on=None, side: str = 'left', starting: date = None, ending: date = None)#
Splits the calendar at the given business day, assuming that the passed index is the first (or last) date of each period.
- Parameters:
- Returns:
The collection of calendars each starting or ending on the given business day
- Return type:
Example
Split the calendar on the 10th business day each month
>>> from doubledate import BD >>> calendar = Calendar(dates) >>> calendar.split(BD(10, "M")) <doubledate.Collection at 0x7fd0fa52c2e0>
Split the calendar on the penultimate day each quarter
>>> calendar.split(BD(-2, "Y")) <doubledate.Collection at 0x7fd0fa52c2e0>
See also
Calendar.groupby
Split the calendar on a criteria