xarray.core.groupby.DataArrayGroupBy.where

DataArrayGroupBy.where(cond)

Return an object of the same shape with all entries where cond is True and all other entries masked.

This operation follows the normal broadcasting and alignment rules that xarray uses for binary arithmetic.

Parameters:cond : DataArray or Dataset
Returns:same type as the grouped object

See also

Dataset.where