Skip to content

Creating datasets with dask xarray arrays issue #5447

Answered by keewis
miguelcarcamov asked this question in Q&A
Discussion options

You must be logged in to vote

The reason this fails is that xr.Dataset({var: ("dim", data_array)}) casts the DataArray to numpy (you're constructing a new variable from a DataArray and a new dimension name). With a recent version of xarray you should get a warning suggesting the use of .data, which will become a error in the future.

This means that the second version is the only one that is supported.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@miguelcarcamov
Comment options

@keewis
Comment options

@dcherian
Comment options

Answer selected by max-sixty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants