rolling() (Pandas)

s.rolling(window) creates a sliding window over a Series or DataFrame so you can compute moving statistics like rolling means and sums. It is the core tool…