home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 374025325

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
374025325 MDU6SXNzdWUzNzQwMjUzMjU= 2511 Array indexing with dask arrays 13190237 closed 0     20 2018-10-25T16:13:11Z 2023-03-15T02:48:00Z 2023-03-15T02:48:00Z CONTRIBUTOR      

Code example

```python da = xr.DataArray(np.ones((10, 10))).chunk(2) indc = xr.DataArray(np.random.randint(0, 9, 10)).chunk(2)

This fails:

da[{'dim_1' : indc}].values ```

Problem description

Indexing with chunked arrays fails, whereas it's fine with "normal" arrays. In case the indices are the result of a lazy calculation, I would like to continue lazily.

Expected Output

I would expect an output just like in the "un-chunked" case:

``` da[{'dim_1' : indc.compute()}].values

Returns: array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])

```

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.7.0.final.0 python-bits: 64 OS: Linux OS-release: 4.18.14-arch1-1-ARCH machine: x86_64 processor: byteorder: little LC_ALL: None LANG: de_DE.utf8 LOCALE: de_DE.UTF-8 xarray: 0.10.9 pandas: 0.23.4 numpy: 1.15.2 scipy: 1.1.0 netCDF4: None h5netcdf: 0.6.2 h5py: 2.8.0 Nio: None zarr: None cftime: None PseudonetCDF: None rasterio: None iris: None bottleneck: 1.2.1 cyordereddict: None dask: 0.19.4 distributed: None matplotlib: 2.2.3 cartopy: 0.16.0 seaborn: None setuptools: 40.4.3 pip: 18.0 conda: None pytest: 3.8.2 IPython: 6.5.0 sphinx: 1.8.0
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2511/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
  • 20 rows from issue in issue_comments
Powered by Datasette · Queries took 0.66ms · About: xarray-datasette