Skip to content

Instantly share code, notes, and snippets.

@yuyasugano
Created September 26, 2020 09:15
Embed
What would you like to do?
Pandas DataFrame tips
print(df.rolling(3, center=True).sum())
num
0 NaN
1 3.0
2 6.0
3 9.0
4 12.0
5 15.0
6 18.0
7 21.0
8 24.0
9 NaN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment