home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 859933298

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
859933298 MDU6SXNzdWU4NTk5MzMyOTg= 5171 Dask now supports item assignment. Shouldn't xarray support it too? 9049976 closed 0     2 2021-04-16T15:38:40Z 2021-05-01T23:35:44Z 2021-05-01T23:35:44Z CONTRIBUTOR      

As of a few weeks ago, dask now supports item assignment. Documentation here.

At the moment, xarray prevents item assignment if a DataArray uses dask arrays. ```

import xarray as xr foo = xr.DataArray([1,2,3,4,5,6], dims=('x'), coords={'x':[1,2,3,4,5,6]}).chunk(2) foo.loc[1] = 44 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/tammas/miniconda3/envs/da/lib/python3.8/site-packages/xarray/core/dataarray.py", line 213, in setitem self.data_array[pos_indexers] = value File "/home/tammas/miniconda3/envs/da/lib/python3.8/site-packages/xarray/core/dataarray.py", line 724, in setitem self.variable[key] = value File "/home/tammas/miniconda3/envs/da/lib/python3.8/site-packages/xarray/core/variable.py", line 889, in setitem indexable[index_tuple] = value File "/home/tammas/miniconda3/envs/da/lib/python3.8/site-packages/xarray/core/indexing.py", line 1379, in setitem raise TypeError( TypeError: this variable's data is stored in a dask array, which does not support item assignment. To assign to this variable, you must first load it into memory explicitly using the .load() method or accessing its .values attribute. ```

Now that this is possible in dask, shouldn't xarray allow it too if the installed dask version supports it?

Kind regards, Tam

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

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