MCPcopy Create free account
hub / github.com/dask/dask / masked_where

Function masked_where

dask/array/ma.py:77–90  ·  view source on GitHub ↗
(condition, a)

Source from the content-addressed store, hash-verified

75
76@derived_from(np.ma)
77def masked_where(condition, a):
78 cshape = getattr(condition, "shape", ())
79 if cshape and cshape != a.shape:
80 raise IndexError(
81 "Inconsistent shape between the condition and the "
82 "input (got %s and %s)" % (cshape, a.shape)
83 )
84 condition = asanyarray(condition)
85 a = asanyarray(a)
86 ainds = tuple(range(a.ndim))
87 cinds = tuple(range(condition.ndim))
88 return blockwise(
89 np.ma.masked_where, ainds, condition, cinds, a, ainds, dtype=a.dtype
90 )
91
92
93@derived_from(np.ma)

Callers

nothing calls this directly

Calls 2

asanyarrayFunction · 0.90
blockwiseFunction · 0.70

Tested by

no test coverage detected