I want to create a new column in pandas data frame 'day_after_long_weekend' based on the conditions shown in the image.
Sat and Sun are default holidays
- condition 1 - if Fri is a holiday (national/provincial) then Monday is the day after long weekend.
- condition 2 - if Fri and following Monday is a holiday then Tuesday is the day after long weekend.
- condition 3 - if Mon and Tuesday is a holiday then Wednesday will be 1, etc.
df = pd.DataFrame([[0, 1, 'Fri'], [0, 0, 'Sat'], [0, 0, 'Sun'], [0, 0, 'Mon'],[0, 0, 'Tue'],[0, 0, 'Wed'],[0, 0, 'Thu'],[0, 1, 'Fri'],[0, 0, 'Sat'],[0, 0, 'Sun'],[1, 0, 'Mon'],[0, 0, 'Tue']] , columns=['national_holiday', 'provincial_holiday','day_of week'])
How can I do this? Any help will be appreciated.