(condition, a)
| 75 | |
| 76 | @derived_from(np.ma) |
| 77 | def 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) |
nothing calls this directly
no test coverage detected