Replies: 1 comment 2 replies
-
Would you need to use (
) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on the following 3D dataset :
My goal is to apply the following function over each
index
*model
combination :My understanding is that
xarray.apply_ufunc()
is a good candidate for this task. I followed the documentation and went through the tutorial to come up with this :What I expect is a 2D dataset with
index
*model
as dimensions containing the result of the function as variables. But I'm unable to find the right combination ofinput_core_dims
,output_core_dims
andexclude_dims
that would make it work. I invariably get the following error :ValueError: Length of values (34) does not match length of index (7670)
orValueError: Length of values (10000) does not match length of index (7670)
.Am I missing something here?
Edit
I could make it work by loading the dataset into memory before passing it to
apply_ufunc()
(usingds.compute()
). I don't know why dimensions are understood properly this way. This solution is not really desirable however, as the dataset is quite large and would not fit on all systems.Beta Was this translation helpful? Give feedback.
All reactions