MCPcopy Index your code
hub / github.com/pydata/xarray / where

Method where

xarray/core/groupby.py:1438–1457  ·  view source on GitHub ↗

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

(self, cond, other=dtypes.NA)

Source from the content-addressed store, hash-verified

1436 )
1437
1438 def where(self, cond, other=dtypes.NA) -> T_Xarray:
1439 """Return elements from `self` or `other` depending on `cond`.
1440
1441 Parameters
1442 ----------
1443 cond : DataArray or Dataset
1444 Locations at which to preserve this objects values. dtypes have to be `bool`
1445 other : scalar, DataArray or Dataset, optional
1446 Value to use for locations in this object where ``cond`` is False.
1447 By default, inserts missing values.
1448
1449 Returns
1450 -------
1451 same type as the grouped object
1452
1453 See Also
1454 --------
1455 Dataset.where
1456 """
1457 return ops.where_method(self, cond, other)
1458
1459 def _first_or_last(
1460 self,

Callers 15

_fill_with_last_oneFunction · 0.45
pushFunction · 0.45
encodeMethod · 0.45
_get_nearest_indexerMethod · 0.45
newplotfuncFunction · 0.45
interpMethod · 0.45
first_itemsMethod · 0.45
_get_nan_block_lengthsFunction · 0.45
interp_naFunction · 0.45
whereFunction · 0.45

Calls

no outgoing calls

Tested by 15

np_cov_indFunction · 0.36
np_covFunction · 0.36
np_corr_indFunction · 0.36
np_corrFunction · 0.36
test_covcorr_consistencyFunction · 0.36
test_autocovFunction · 0.36
test_whereFunction · 0.36
test_where_attrsFunction · 0.36
expected_weightedFunction · 0.36