Returns True if any of the elements of `a` evaluate to True. Masked values are considered as False during computation. Refer to `numpy.any` for full documentation. See Also -------- numpy.ndarray.any : corresponding function for ndarrays nu
(self, axis=None, out=None, keepdims=np._NoValue)
| 5017 | return out |
| 5018 | |
| 5019 | def any(self, axis=None, out=None, keepdims=np._NoValue): |
| 5020 | """ |
| 5021 | Returns True if any of the elements of `a` evaluate to True. |
| 5022 | |
| 5023 | Masked values are considered as False during computation. |
| 5024 | |
| 5025 | Refer to `numpy.any` for full documentation. |
| 5026 | |
| 5027 | See Also |
| 5028 | -------- |
| 5029 | numpy.ndarray.any : corresponding function for ndarrays |
| 5030 | numpy.any : equivalent function |
| 5031 | |
| 5032 | """ |
| 5033 | kwargs = {} if keepdims is np._NoValue else {'keepdims': keepdims} |
| 5034 | |
| 5035 | mask = _check_mask_axis(self._mask, axis, **kwargs) |
| 5036 | if out is None: |
| 5037 | d = self.filled(False).any(axis=axis, **kwargs).view(type(self)) |
| 5038 | if d.ndim: |
| 5039 | d.__setmask__(mask) |
| 5040 | elif mask: |
| 5041 | d = masked |
| 5042 | return d |
| 5043 | self.filled(False).any(axis=axis, out=out, **kwargs) |
| 5044 | if isinstance(out, MaskedArray): |
| 5045 | if out.ndim or mask: |
| 5046 | out.__setmask__(mask) |
| 5047 | return out |
| 5048 | |
| 5049 | def nonzero(self): |
| 5050 | """ |