home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 402413097

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
402413097 MDU6SXNzdWU0MDI0MTMwOTc= 2699 bfill behavior dask arrays with small chunk size 22454970 closed 0     4 2019-01-23T20:19:21Z 2021-04-26T13:06:46Z 2021-04-26T13:06:46Z NONE      

```python data = np.random.rand(100) data[25] = np.nan da = xr.DataArray(data)

unchunked

print('output : orig',da[25].values, ' backfill : ',da.bfill('dim_0')[25].values ) output : orig nan backfill : 0.024710724099643477

small chunk

da1 = da.chunk({'dim_0':1}) print('output chunks==1 : orig',da1[25].values, ' backfill : ',da1.bfill('dim_0')[25].values ) output chunks==1 : orig nan backfill : nan

medium chunk

da1 = da.chunk({'dim_0':10}) print('output chunks==10 : orig',da1[25].values, ' backfill : ',da1.bfill('dim_0')[25].values ) output chunks==10 : orig nan backfill : 0.024710724099643477 ```

Problem description

bfill methods seems to miss nans when dask array chunk size is small. Resulting array still has nan present (see 'small chunk' section of code)

Expected Output

absence of nans

Output of xr.show_versions()

INSTALLED VERSIONS

commit: None python: 3.6.8.final.0 python-bits: 64 OS: Linux OS-release: 4.15.0-43-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_CA.UTF-8 LOCALE: en_CA.UTF-8 xarray: 0.11.0 pandas: 0.23.4 numpy: 1.15.4 scipy: None netCDF4: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None PseudonetCDF: None rasterio: None iris: None bottleneck: 1.2.1 cyordereddict: None dask: 1.0.0 distributed: 1.25.2 matplotlib: None cartopy: None seaborn: None setuptools: 40.6.3 pip: 18.1 conda: None pytest: None IPython: None sphinx: None

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2699/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

  • 3 rows from issues_id in issues_labels
  • 4 rows from issue in issue_comments
Powered by Datasette · Queries took 0.6ms · About: xarray-datasette