pandas.tseries.offsets.CustomBusinessDay.weekmask#
- CustomBusinessDay.weekmask#
Return the weekmask used for custom business day calculations.
This property returns the weekmask string that defines which days of the week are considered business days. For non-custom business offsets (e.g., standard BusinessDay, BusinessHour), this will be None. For custom business day offsets, this returns the weekmask that was specified or the default ‘Mon Tue Wed Thu Fri’.
- Returns:
- str or None
String representing valid business days (e.g., ‘Mon Tue Wed Thu Fri’), or None if using default business day rules.
See also
BusinessDay.holidaysHolidays for standard business day offset.
CustomBusinessDay.holidaysHolidays for custom business day offset.
CustomBusinessDay.calendarCalendar for custom business day offset.
Examples
For standard business offsets, weekmask is None:
>>> bd = pd.offsets.BusinessDay() >>> bd.weekmask is None True
>>> bh = pd.offsets.BusinessHour() >>> bh.weekmask is None True
For custom business day with default weekmask:
>>> cbd = pd.offsets.CustomBusinessDay() >>> cbd.weekmask 'Mon Tue Wed Thu Fri'
For custom business day with custom weekmask:
>>> cbd = pd.offsets.CustomBusinessDay(weekmask="Mon Wed Fri") >>> cbd.weekmask 'Mon Wed Fri'