# Create a date only column
table['DateOnly'] = table['Date'].dt.date# Set the created date only column as Datetime Index
table1 = table.set_index(pd.DatetimeIndex(table['DateOnly']))# Create a new table that shows rolling sum of Income column for a window of 2 days for the Client ID & Category groups
table2 = table1.groupby(by = [table1['ClientID'],table1['Category']]).resample("1d").sum().fillna(0).rolling(window=2, min_periods=1)['Income'].sum()