🍾 Xarray is now 10 years old! 🎉

xarray.core.groupby.DataArrayGroupBy.where

xarray.core.groupby.DataArrayGroupBy.where#

DataArrayGroupBy.where(cond, other=<NA>)[source]#

Return elements from self or other depending on cond.

Parameters:
  • cond (DataArray or Dataset) – Locations at which to preserve this objects values. dtypes have to be bool

  • other (scalar, DataArray or Dataset, optional) – Value to use for locations in this object where cond is False. By default, inserts missing values.

Returns:

same type as the grouped object

See also

Dataset.where