home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 727623263

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
727623263 MDU6SXNzdWU3Mjc2MjMyNjM= 4529 Dataset constructor with DataArray triggers computation 6130352 closed 0     5 2020-10-22T18:27:24Z 2021-02-19T23:13:57Z 2021-02-19T23:13:57Z NONE      

Is it intentional that creating a Dataset with a DataArray and dimension names for a single variable causes computation of that variable? In other words, why does xr.Dataset(dict(a=('d0', xr.DataArray(da.random.random(10))))) cause the dask array to compute?

A longer example:

```python import dask.array as da import xarray as xr x = da.random.randint(1, 10, size=(100, 25)) ds = xr.Dataset(dict(a=xr.DataArray(x, dims=('x', 'y')))) type(ds.a.data) dask.array.core.Array

Recreate the dataset with the same array, but also redefine the dimensions

ds2 = xr.Dataset(dict(a=(('x', 'y'), ds.a)) type(ds2.a.data) numpy.ndarray ```

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

  • 1 row from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.514ms · About: xarray-datasette