MCPcopy Index your code
hub / github.com/numpy/numpy / recordmask

Method recordmask

numpy/ma/core.py:3598–3614  ·  view source on GitHub ↗

Get or set the mask of the array if it has no named fields. For structured arrays, returns an 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

3596
3597 @property
3598 def recordmask(self):
3599 """
3600 Get or set the mask of the array if it has no named fields. For
3601 structured arrays, returns an ndarray of booleans where entries are
3602 ``True`` if **all** the fields are masked, ``False`` otherwise:
3603
3604 >>> x = np.ma.array([(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)],
3605 ... mask=[(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)],
3606 ... dtype=[('a', int), ('b', int)])
3607 >>> x.recordmask
3608 array([False, False, True, False, False])
3609 """
3610
3611 _mask = self._mask.view(ndarray)
3612 if _mask.dtype.names is None:
3613 return _mask
3614 return np.all(flatten_structured_array(_mask), axis=-1)
3615
3616 @recordmask.setter
3617 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