Get week start date (Monday) from a date column in Python (pandas)?

Another alternative:

df['week_start'] = df['myday'].dt.to_period('W').apply(lambda r: r.start_time)

This will set ‘week_start’ to be the first Monday before the time in ‘myday’.

Leave a Comment