Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
little tease solution in 3rd party category for The First Working Day by rybld2
def vacation(date, days):
import pandas as pd
# creeons un tableau de dates de 7 jours à dater du départ
# create an array of dates 7 days from departure
idx = pd.date_range(str(date), periods=7)
df = pd.DataFrame(index=idx)
# candidats possibles après la vaccation
# possible candidates days after vacation
df['day_2_work'] = df.index + pd.DateOffset(days)
# excluons samedi et dimanche
# exclude saturday and sunday
df['Day'] = df['day_2_work'].map(lambda dt: dt.weekday())
df_res = df.query("Day not in [5, 6]").copy()
# mise en forme du résultat
# formatting the result
df_res['day_start'] = df_res.day_2_work.dt.strftime('%Y-%m-%d')
res = df_res.iloc[0]['day_start']
return (res)
June 11, 2021