Skip to content

Using xr.apply_ufunc in a masked DataArray in an efficient way #7627

Discussion options

You must be logged in to vote

No, that's not possible. You could short-circuit the all-NaN case in your custom function though.

So


if np.isnan(x).all():
    return np.nan

Or something lilke that

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ricardobarroslourenco
Comment options

Answer selected by ricardobarroslourenco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants