Pandas convert daily data to weekly Thursday to Wednesday

I have a dataset with three columns; 'Sales', per 'ItemId' on each 'Date'. I want to convert the daily sales to weekly sales and adding a new date column indicating the date of the first day of the week of the aggregation. When this would be done by aggregating the sales from Monday to Sunday this would look like:
df['year_week'] = df.FSF_Date.dt.strftime('%G-w%V')
df_Weekly = df.groupby(['year_week'])['Sales'].sum().reset_index() df_Weekly ['Date'] = pd.to_datetime(df_Weekly['year_week'] + "-Monday", format ='%G-w%V-%A') However, i want to aggregate the sales from Thursday to Wednesday with the date of Thursday in the new 'Date' column. Anyone any ideas on this?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum