Creating datasets with dask xarray arrays issue #5447
-
When creating a dataset with xarray arrays with dask arrays inside then when doing a calculation there seems to be no dask array in the variables. However, if I force the dataset to use dask arrays using .data the variables are indeed dask arrays. I was wondering if xarray chooses to use dask array or numpy arrays when creating the dataset depending on the memory of the machine or if this is done automatically. Example:
However, if I do:
I get:
Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The reason this fails is that This means that the second version is the only one that is supported. |
Beta Was this translation helpful? Give feedback.
The reason this fails is that
xr.Dataset({var: ("dim", data_array)})
casts theDataArray
tonumpy
(you're constructing a new variable from aDataArray
and a new dimension name). With a recent version ofxarray
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.