I have a time series \"Ser\" and I want to compute volatilities (standard deviations) with a rolling window. My current code correctly does it in this form:
w=10
It looks like you are looking for Series.rolling. You can apply the std calculations to the resulting object:
roller = Ser.rolling(w)
volList = roller.std(ddof=0)
If you don't plan on using the rolling window object again, you can write a one-liner:
volList = Ser.rolling(w).std(ddof=0)
Keep in mind that ddof=0 is necessary in this case because the normalization of the standard deviation is by len(Ser)-ddof, and that ddof defaults to 1 in pandas.