Creating lag windows in pandas is slow for large dataset
#### Code Sample, a copy-pastable example if possible
```python
# Your code here
for lag in [2, 3, 7, 15, 21]:
                df_tmp.set_index("date")
                .groupby("group")
                .resample("D")
                .sum()
                .groupby("group")
                .shift()
                .reset_index()
                .fillna(0)
                .groupby("group")
                .rolling(f"{lag}D", on="date")
                .agg(self.funcs)[self.cols]
```

I want to add sum_click_last2days, mean_click_last2days, sum_click_last4days, mean_click_last4days and so on depending on columns, functions and lag windows passed.
Here last n days mean rolling sum till last day. Hence, if we are running on 10th, we would want sum for 8th and 9th.
This is working fine for smaller dataset but is not efficient for a large dataset( 19M and there are 700K groups)
#### Problem description
This is working fine for smaller dataset but is not efficient for a large dataset( 19M and there are 700K groups)
