I have a df:
date
2021-06-28
2021-06-29
2021-06-30
2021-07-02
2021-07-04
2021-07-07
2021-08-06
2021-08-07
I am trying to convert this to week, I know I can use df.date.dt.isocalendar().week but this returns the week number with the default start date, whereas my start date is 2021-06-28.
I can achieve the dates in df using pd.Grouper(key = 'date', freq = 'W-MON', label = 'left', closed = 'left') in a groupby but I would like to have the same output without using groupby - simply applying a function to date column.
My goal is to have:
date
2021-06-28
2021-06-28
2021-06-28
2021-06-28
2021-06-28
2021-07-05
2021-08-02
2021-08-02
Because these dates represent the Monday of each week that the date falls in.