pandas.tseries.holiday.next_monday_or_tuesday#
- pandas.tseries.holiday.next_monday_or_tuesday(dt)[source]#
Move Saturday to Monday, and Sunday or Monday to Tuesday.
Use this for the second of two adjacent holidays, where the Monday is already taken by the holiday of the day before.
- Parameters:
- dtdatetime
The date the holiday falls on.
- Returns:
- datetime
The date the holiday is observed on.
See also
tseries.holiday.next_mondayMove Saturday and Sunday to the following Monday.
tseries.holiday.after_nearest_workdayMove to the workday after the nearest workday.
tseries.holiday.HolidayClass that defines a holiday with start/end dates and rules for observance.
Examples
>>> from datetime import datetime >>> from pandas.tseries.holiday import next_monday_or_tuesday >>> next_monday_or_tuesday(datetime(2022, 1, 1)) # Saturday datetime.datetime(2022, 1, 3, 0, 0) >>> next_monday_or_tuesday(datetime(2022, 1, 2)) # Sunday datetime.datetime(2022, 1, 4, 0, 0) >>> next_monday_or_tuesday(datetime(2022, 1, 3)) # Monday datetime.datetime(2022, 1, 4, 0, 0)