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

Function sum_where

xarray/core/duck_array_ops.py:397–404  ·  view source on GitHub ↗
(data, axis=None, dtype=None, where=None)

Source from the content-addressed store, hash-verified

395
396
397def sum_where(data, axis=None, dtype=None, where=None):
398 xp = get_array_namespace(data)
399 if where is not None:
400 a = where_method(xp.zeros_like(data), where, data)
401 else:
402 a = data
403 result = xp.sum(a, axis=axis, dtype=dtype)
404 return result
405
406
407def where(condition, x, y):

Callers 1

nansumFunction · 0.90

Calls 3

get_array_namespaceFunction · 0.90
where_methodFunction · 0.70
sumMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…