-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rolling.mean vs rolling.construct.mean #2010
Comments
Hi, @mathause. Thanks for reporting. I agree that this behavior is a little surprising, but this is something expected. In [7]: ds.rolling(dim=3, center=True, min_periods=1).mean()
Out[7]:
<xarray.DataArray (dim: 4)>
array([0.5, 1. , 2. , 2.5])
Dimensions without coordinates: dim I am not sure how we can make both the behaviors the same with keeping the generality of |
I think we need to document more clearly that |
Ok, so On the other hand, using
Actually I'm sure that |
Yes. Originally,
It is not strictly true. |
I also think we could label At the moment we say "You can use this for more advanced rolling operations, such as strided rolling, windowed rolling, convolution, short-time FFT, etc."; |
Would it make sense to support |
I think that masking the |
In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here or remove the |
Code Sample, a copy-pastable example if possible
Problem description
ds.rolling(...).mean()
andds.rolling(...).construct().mean()
yields different results. Becausemean
doesskipna=True
per default.Expected Output
I would expect both ways to yield the same result.
Output of
xr.show_versions()
xarray: 0.10.2+dev6.g9261601
pandas: 0.22.0
numpy: 1.14.2
scipy: 1.0.0
netCDF4: 1.3.1
h5netcdf: None
h5py: None
Nio: None
zarr: None
bottleneck: 1.2.1
cyordereddict: 1.0.0
dask: 0.17.1
distributed: 1.21.3
matplotlib: 2.2.2
cartopy: None
seaborn: None
setuptools: 39.0.1
pip: 9.0.2
conda: None
pytest: 3.4.2
IPython: 6.2.1
sphinx: None
The text was updated successfully, but these errors were encountered: