As you can see, the code is from the PANDAS official example, the STD of the last 3 numbers(5,5,5) should be 0, but it's not in the example.
In [1]: s = pd.Series([5,5,6,7,5,5,5])
In [2]: s.rolling(3).std()
Out[2]:
0 NaN
1 NaN
2 5.773503e-01
3 1.000000e+00
4 1.000000e+00
5 1.154701e+00
6 2.580957e-08
dtype: float64
If I reverse the array, the outcomes seem correct. I don't know why.
In [3]: s[::-1].rolling(3).std()
Out[3]:
6 NaN
5 NaN
4 0.000000
3 1.154701
2 1.000000
1 1.000000
0 0.577350
dtype: float64