EDIT -- Unfortunately, it looks like the new way is not nearly as fast:
New version of Pandas:
In [1]: x = np.random.uniform(size=100)
In [2]: %timeit pd.rolling_mean(x, window=2)
1000 loops, best of 3: 240 μs per loop
In [3]: %timeit pd.Series(x).rolling(window=2).mean()
1000 loops, best of 3: 226 μs per loop
In [4]: pd.__version__
Out[4]: '0.18.0'
Old version:
In [1]: x = np.random.uniform(size=100)
In [2]: %timeit pd.rolling_mean(x,window=2)
100000 loops, best of 3: 12.4 μs per loop
In [3]: pd.__version__
Out[3]: u'0.17.1'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…