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)
| 4946 | return out |
| 4947 | |
| 4948 | def any(self, axis=None, out=None, keepdims=np._NoValue): |
| 4949 | """ |
| 4950 | Returns True if any of the elements of `a` evaluate to True. |
| 4951 | |
| 4952 | Masked values are considered as False during computation. |
| 4953 | |
| 4954 | Refer to `numpy.any` for full documentation. |
| 4955 | |
| 4956 | See Also |
| 4957 | -------- |
| 4958 | numpy.ndarray.any : corresponding function for ndarrays |
| 4959 | numpy.any : equivalent function |
| 4960 | |
| 4961 | """ |
| 4962 | kwargs = {} if keepdims is np._NoValue else {'keepdims': keepdims} |
| 4963 | |
| 4964 | mask = _check_mask_axis(self._mask, axis, **kwargs) |
| 4965 | if out is None: |
| 4966 | d = self.filled(False).any(axis=axis, **kwargs).view(type(self)) |
| 4967 | if d.ndim: |
| 4968 | d.__setmask__(mask) |
| 4969 | elif mask: |
| 4970 | d = masked |
| 4971 | return d |
| 4972 | self.filled(False).any(axis=axis, out=out, **kwargs) |
| 4973 | if isinstance(out, MaskedArray): |
| 4974 | if out.ndim or mask: |
| 4975 | out.__setmask__(mask) |
| 4976 | return out |
| 4977 | |
| 4978 | def nonzero(self): |
| 4979 | """ |