Skip to content

Instantly share code, notes, and snippets.

@yuyasugano
Created September 26, 2020 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuyasugano/0ce83f65d9f6a77ab1490ed6ac39e414 to your computer and use it in GitHub Desktop.
Save yuyasugano/0ce83f65d9f6a77ab1490ed6ac39e414 to your computer and use it in GitHub Desktop.
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