BUG: ewm*() interpretation of min_periods is off by one by seth-p · Pull Request #7898 · pandas-dev/pandas (original) (raw)
In the process of adding tests for min_periods = 0, 1, I noticed the following, which is really messing up the testing. I think all these functions should return NaN
for a single value.
I just noticed that ewmvar
, ewmstd
, ewmvol
, ewmcov
, rolling_var
, rolling_std
, returns 0.0
for a single value (assuming min_periods=0
); whereas Series.std
, Series.var
, ewmcorr
, expanding_cov
, expanding_corr
, expanding_std
, expanding_vol
, and expanding_var
, rolling_cov
, and rolling_corr
all return NaN
for a single value.