pandas.tseries.offsets.BusinessMonthBegin.is_on_offset#
- BusinessMonthBegin.is_on_offset(dt)#
Return boolean whether a timestamp intersects with this frequency.
This method determines if a given timestamp aligns with the specific day of the month defined by this offset. For month-based offsets, it checks whether the timestamp’s day matches the expected day according to the offset’s configuration (e.g., start of month, end of month, or first/last business day).
- Parameters:
- dtdatetime
Timestamp to check intersection with frequency.
- Returns:
- bool
True if the timestamp is on the offset, False otherwise.
See also
tseries.offsets.MonthBeginDateOffset of one month at beginning.
tseries.offsets.MonthEndDateOffset of one month end.
tseries.offsets.BusinessMonthBeginDateOffset of one month at the first business day.
tseries.offsets.BusinessMonthEndDateOffset of one month at the last business day.
Examples
>>> ts = pd.Timestamp(2022, 1, 1) >>> pd.offsets.MonthBegin().is_on_offset(ts) True
>>> ts = pd.Timestamp(2022, 1, 15) >>> pd.offsets.MonthBegin().is_on_offset(ts) False
>>> ts = pd.Timestamp(2022, 1, 31) >>> pd.offsets.MonthEnd().is_on_offset(ts) True