feature request: min_periods parameter for moving functions #53

Closed
erg opened this Issue Sep 6, 2012 · 1 comment

Comments

Projects
None yet
2 participants

erg commented Sep 6, 2012

Sometimes it's useful to get a rolling mean over the entire input.

import pandas

In [8]: pandas.rolling_mean(np.array([1,2,3,4,5]),3)
Out[8]: array([ nan,  nan,   2.,   3.,   4.])

In [9]: pandas.rolling_mean(np.array([1,2,3,4,5]),3, min_periods=1)
Out[9]: array([ 1. ,  1.5,  2. ,  3. ,  4. ])
Owner

kwgoodman commented Feb 4, 2015

Done! But named it min_count.

@kwgoodman kwgoodman closed this Feb 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment