pandas.tseries.offsets.SemiMonthBegin.is_on_offset#
- SemiMonthBegin.is_on_offset(dt)#
Return boolean whether a timestamp intersects with this frequency.
This method checks if the given timestamp falls on the first day of the month or on the specified
day_of_month. It is used to determine if a date aligns with the semi-monthly frequency starting at the beginning of the month.- Parameters:
- dtdatetime
Timestamp to check intersections with frequency.
- Returns:
- bool
True if the date is on the first day of the month or the
day_of_month, False otherwise.
See also
SemiMonthEnd.is_on_offsetCheck if a date falls on a SemiMonthEnd offset.
Examples
>>> ts = pd.Timestamp(2022, 1, 1) >>> freq = pd.offsets.SemiMonthBegin() >>> freq.is_on_offset(ts) True
>>> ts = pd.Timestamp(2022, 1, 15) >>> freq.is_on_offset(ts) True
>>> ts = pd.Timestamp(2022, 1, 16) >>> freq.is_on_offset(ts) False