I have a solution to this for one column:
df = df.join(df.groupby(\'id\').apply( lambda x: x[\'total_points\'].rolling(min_periods=1, window=4).sum())