# add week and month to df df['week'] = df['delivery_week'].dt.isocalendar().week df['month'] = df['delivery_week'].dt.month # one hot encode week and month df = pd.get_dummies(df, columns=['week', 'month'], dtype=int)