Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pandas DataFrame tips
print(df.rolling(3, win_type='triang').sum())
num
0 NaN
1 NaN
2 2.0
3 4.0
4 6.0
5 8.0
6 10.0
7 12.0
8 14.0
9 16.0
print(df.rolling(3, win_type='exponential').sum(tau=1))
num
0 NaN
1 NaN
2 1.735759
3 3.471518
4 5.207277
5 6.943036
6 8.678794
7 10.414553
8 12.150312
9 13.886071
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment