-
-
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
DataArrayRolling.mean() ignores skipna=True
kwarg
#6772
Comments
Apologies for letting this sit for so long. The reason for the unexpected behavior seems to be that Line 176 in 21d8645
Lines 161 to 163 in 21d8645
where min_periods is applied in the sum (by masking values where count < min_periods ).
However, So if you were to set @pydata/xarray, any idea what to do here? Should we document that passing |
I think the reason it's like this is the conflict We could just raise and ask the user to provide an appropriate |
What happened?
In the following example, it appears that the
skipna=True
argument is being ignored, unless you callconstruct
before taking the mean.What did you expect to happen?
I expected:
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
Note: the first two NaNs are expected due to the
min_periods
argument torolling()
, but the middle NaNs are what are unexpected whenskipna = True
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
The text was updated successfully, but these errors were encountered: