issues: 1301023040
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1301023040 | I_kwDOAMm_X85NjAlA | 6772 | DataArrayRolling.mean() ignores `skipna=True` kwarg | 16807224 | open | 0 | 2 | 2022-07-11T17:43:10Z | 2023-02-21T16:53:35Z | NONE | What happened?In the following example, it appears that the What did you expect to happen?I expected:
Minimal Complete Verifiable Example```Python import xarray as xr import numpy as np da = xr.DataArray([0, 1, 2, np.NAN, 4, 5, 6], dims="time") Results 1 and 2 produce the same array, without skipping NANsresult1 = da.rolling(time=3).mean("time", skipna=True) result2 = da.rolling(time=3).mean("time", skipna=False) Results 3 and 4 produce the expected (different) arraysresult3 = da.rolling(time=3).construct("window").mean("window", skipna=True) result4 = da.rolling(time=3).construct("window").mean("window", skipna=False) print(result1) print(result2) print(result3) print(result4) ``` MVCE confirmation
Relevant log output
Anything else we need to know?Note: the first two NaNs are expected due to the Environment
INSTALLED VERSIONS
------------------
commit: None
python: 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:50:36) [MSC v.1929 64 bit (AMD64)]
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: AMD64 Family 23 Model 17 Stepping 0, AuthenticAMD
byteorder: little
LC_ALL: None
LANG: None
LOCALE: ('English_United States', '1252')
libhdf5: 1.12.1
libnetcdf: 4.8.1
xarray: 0.19.0
pandas: 1.3.4
numpy: 1.21.2
scipy: 1.7.1
netCDF4: 1.6.0
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: 2.12.0
cftime: 1.6.0
nc_time_axis: None
PseudoNetCDF: None
rasterio: 1.2.10
cfgrib: None
iris: None
bottleneck: None
dask: 2022.6.1
distributed: 2022.6.1
matplotlib: 3.4.3
cartopy: 0.20.1
seaborn: None
numbagg: None
pint: 0.19.2
setuptools: 59.8.0
pip: 22.1.2
conda: None
pytest: 7.1.2
IPython: 8.4.0
sphinx: None
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6772/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
reopened | 13221727 | issue |