Returns True if all elements evaluate to True. The output array is masked where all the values along the given axis are masked: if the output would have been a scalar and that all the values are masked, then the output is `masked`. Refer to `numpy.all` for
(self, axis=None, out=None, keepdims=np._NoValue)
| 4976 | return self.flags['CONTIGUOUS'] |
| 4977 | |
| 4978 | def all(self, axis=None, out=None, keepdims=np._NoValue): |
| 4979 | """ |
| 4980 | Returns True if all elements evaluate to True. |
| 4981 | |
| 4982 | The output array is masked where all the values along the given axis |
| 4983 | are masked: if the output would have been a scalar and that all the |
| 4984 | values are masked, then the output is `masked`. |
| 4985 | |
| 4986 | Refer to `numpy.all` for full documentation. |
| 4987 | |
| 4988 | See Also |
| 4989 | -------- |
| 4990 | numpy.ndarray.all : corresponding function for ndarrays |
| 4991 | numpy.all : equivalent function |
| 4992 | |
| 4993 | Examples |
| 4994 | -------- |
| 4995 | >>> import numpy as np |
| 4996 | >>> np.ma.array([1,2,3]).all() |
| 4997 | True |
| 4998 | >>> a = np.ma.array([1,2,3], mask=True) |
| 4999 | >>> (a.all() is np.ma.masked) |
| 5000 | True |
| 5001 | |
| 5002 | """ |
| 5003 | kwargs = {} if keepdims is np._NoValue else {'keepdims': keepdims} |
| 5004 | |
| 5005 | mask = _check_mask_axis(self._mask, axis, **kwargs) |
| 5006 | if out is None: |
| 5007 | d = self.filled(True).all(axis=axis, **kwargs).view(type(self)) |
| 5008 | if d.ndim: |
| 5009 | d.__setmask__(mask) |
| 5010 | elif mask: |
| 5011 | return masked |
| 5012 | return d |
| 5013 | self.filled(True).all(axis=axis, out=out, **kwargs) |
| 5014 | if isinstance(out, MaskedArray): |
| 5015 | if out.ndim or mask: |
| 5016 | out.__setmask__(mask) |
| 5017 | return out |
| 5018 | |
| 5019 | def any(self, axis=None, out=None, keepdims=np._NoValue): |
| 5020 | """ |