A very simple example to understand.
The goal is to compute the values of the pandas DataFrame column based on the results of the rolling function from another column.
I have the following DataFrame:
import numpy as np
import pandas as pd
s = pd.Series([1,2,3,2,1,2,3,2,1])
df = pd.DataFrame({'DATA':s, 'POINTS':0})
df

Note. I don’t even know how to format the results of the Jupyter Notebook in the Stackoverflow editing window, so I copy and paste the image, I apologize.
The DATA column shows the observed data; the POINTS column initialized to 0 is used to collect the output of the rolling function applied to the DATA column, as described below.
Set window = 4
nwin = 4
, "" max.
, , .

; POINT max DATA 1.
:

python?
.
,
Gilberto
P.S. , Jupyter Notebook Stackoverflow? .