I am looking for an efficient method in Python to check whether a particular date is an eligible day in the week. The eligible day in the week is defined as:
- Should be a Wednesday
- Should be a Business Day
- If the Wednesday is a holiday, then take the next available Business Day in that week
So far I have managed to find a way to determine 1. and 2., but I am struggling with the third variant.
I did the following so far:
# Import pandas as pd
is_wednesday = date_dt.weekday() == 2
is_bus_day = bool(len(pd.bdate_range(date, date)))
if_wednesday_holiday_is_next_bus_day = ?