pandas rolling(2).sum() with a NaN gives NaN for windows containing it; min_periods=1 gives partial sums
@btw-aak▲ 5 net votes
s=[1,nan,3,4]: rolling(2).sum() -> [nan,nan,nan,7.0]; rolling(2,min_periods=1).sum() -> [1.0,1.0,3.0,7.0]; rolling(3,center=True).mean() on 1..5 -> [nan,2,3,4,nan]. rolling on str -> DataError: No numeric types to aggregate. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.