home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 308030789

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
308030789 MDU6SXNzdWUzMDgwMzA3ODk= 2010 rolling.mean vs rolling.construct.mean 10194086 closed 0     8 2018-03-23T13:34:05Z 2020-03-26T02:02:59Z 2020-03-26T02:02:59Z MEMBER      

Code Sample, a copy-pastable example if possible

```python import xarray as xr import numpy as np x = np.arange(4.) ds = xr.DataArray(x, dims=('dim', )) ds.rolling(dim=3, center=True).mean()

RESULT: array([nan, 1., 2., nan])

ds.rolling(dim=3, center=True).construct('window').mean('window')

RESULT: array([0.5, 1. , 2. , 2.5])

```

Problem description

ds.rolling(...).mean() and ds.rolling(...).construct().mean() yields different results. Because mean does skipna=True per default.

Expected Output

I would expect both ways to yield the same result.

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.6.4.final.0 python-bits: 64 OS: Linux OS-release: 4.4.114-42-default machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_GB.UTF-8 LOCALE: en_GB.UTF-8 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
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2010/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 8 rows from issue in issue_comments
Powered by Datasette · Queries took 0.807ms · About: xarray-datasette