See pandas.expanding_std .
eg:
import numpy as np import matplotlib.pyplot as plt import pandas %matplotlib inline data = pandas.Series(np.random.normal(size=37)) full_std = np.std(data) expand_std = pandas.expanding_std(data, min_periods=1) fig, ax = plt.subplots() expand_std.plot(ax=ax, color='k', linewidth=1.5, label='Expanded Std. Dev.') ax.axhline(y=full_std, color='g', label='Full Value') ax.legend()
Edit: oops, forgot the picture:

Paul H Jun 23 '14 at 17:01 2014-06-23 17:01
source share