MCPcopy Create free account
hub / github.com/numpy/numpy / recordmask

Method recordmask

numpy/ma/core.py:3531–3547  ·  view source on GitHub ↗

Get or set the mask of the array if it has no named fields. For structured arrays, returns a ndarray of booleans where entries are ``True`` if **all** the fields are masked, ``False`` otherwise: >>> x = np.ma.array([(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)], .

(self)

Source from the content-addressed store, hash-verified

3529
3530 @property
3531 def recordmask(self):
3532 """
3533 Get or set the mask of the array if it has no named fields. For
3534 structured arrays, returns a ndarray of booleans where entries are
3535 ``True`` if **all** the fields are masked, ``False`` otherwise:
3536
3537 >>> x = np.ma.array([(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)],
3538 ... mask=[(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)],
3539 ... dtype=[('a', int), ('b', int)])
3540 >>> x.recordmask
3541 array([False, False, True, False, False])
3542 """
3543
3544 _mask = self._mask.view(ndarray)
3545 if _mask.dtype.names is None:
3546 return _mask
3547 return np.all(flatten_structured_array(_mask), axis=-1)
3548
3549 @recordmask.setter
3550 def recordmask(self, mask):

Callers

nothing calls this directly

Calls 3

flatten_structured_arrayFunction · 0.85
viewMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected