BD#

class doubledate.BD(index: int, frequency: str = 'M', *, base: int = 0)#

Business day.

Parameters:
  • index (int) – day of the frequency

  • frequency (str) – one of ‘D’,’W’,’M’,’Q’,’H’ or ‘Y’

  • base (0 (default), 1) – whether to consider the index 1-based or 0-based

resolve(calendar, onerror: str = 'skip')#

Returns a new Calendar containing only the n’th business day each frequency.

Allowed values for the onerror parameter:
  • ‘skip’ to skip periods where the n’th business day is not defined

  • ‘first’ to fallback to the first date in the period when the n’th business day is not defined

  • ‘last’ to fallback to the last date in the period when the n’th business day is not defined

  • ‘raise’ to raise an error if the n’th business day is not defined

Parameters:
  • calendar (Calendar) – the calendar from which to compute the n’th business day

  • onerror (str) – handling policy for periods the n’th business day is not defined

Returns:

Calendar containing the n’th business day each frequency

Return type:

Calendar