You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here cond could be a boolean array matching the size of the element, or it could be a dim-expression. The result would be an element of the same type as the input, with the same size, but the values where cond is True would be replaced by other.
One application of this method would be to support arbitrary dim expression filtering on gridded datasets. If other is nan, this would make it possible to overlay a subset of an image on top of itself, where the subset is not a clean slice, but an arbitrary function of the element's dimensions.
The text was updated successfully, but these errors were encountered:
It would be nice to have an xarray-style
where
method (http://xarray.pydata.org/en/stable/generated/xarray.DataArray.where.html) on elements.The signature would be something like
Here
cond
could be a boolean array matching the size of the element, or it could be adim
-expression. The result would be an element of the same type as the input, with the same size, but the values wherecond
isTrue
would be replaced byother
.One application of this method would be to support arbitrary
dim
expression filtering on gridded datasets. Ifother
isnan
, this would make it possible to overlay a subset of an image on top of itself, where the subset is not a clean slice, but an arbitrary function of the element's dimensions.The text was updated successfully, but these errors were encountered: