Skip to content

Commit 08b70d8

Browse files
MarcoGorelliWillAyd
authored andcommitted
📝 add example of rolling with win_type gaussian (pandas-dev#30813)
1 parent 50842c0 commit 08b70d8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/core/window/rolling.py

+11
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,17 @@ class Window(_Window):
872872
3 NaN
873873
4 NaN
874874
875+
Rolling sum with a window length of 2, using the 'gaussian'
876+
window type (note how we need to specify std).
877+
878+
>>> df.rolling(2, win_type='gaussian').sum(std=3)
879+
B
880+
0 NaN
881+
1 0.986207
882+
2 2.958621
883+
3 NaN
884+
4 NaN
885+
875886
Rolling sum with a window length of 2, min_periods defaults
876887
to the window length.
877888

0 commit comments

Comments
 (0)