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)
| 4906 | return self.flags['CONTIGUOUS'] |
| 4907 | |
| 4908 | def all(self, axis=None, out=None, keepdims=np._NoValue): |
| 4909 | """ |
| 4910 | Returns True if all elements evaluate to True. |
| 4911 | |
| 4912 | The output array is masked where all the values along the given axis |
| 4913 | are masked: if the output would have been a scalar and that all the |
| 4914 | values are masked, then the output is `masked`. |
| 4915 | |
| 4916 | Refer to `numpy.all` for full documentation. |
| 4917 | |
| 4918 | See Also |
| 4919 | -------- |
| 4920 | numpy.ndarray.all : corresponding function for ndarrays |
| 4921 | numpy.all : equivalent function |
| 4922 | |
| 4923 | Examples |
| 4924 | -------- |
| 4925 | >>> np.ma.array([1,2,3]).all() |
| 4926 | True |
| 4927 | >>> a = np.ma.array([1,2,3], mask=True) |
| 4928 | >>> (a.all() is np.ma.masked) |
| 4929 | True |
| 4930 | |
| 4931 | """ |
| 4932 | kwargs = {} if keepdims is np._NoValue else {'keepdims': keepdims} |
| 4933 | |
| 4934 | mask = _check_mask_axis(self._mask, axis, **kwargs) |
| 4935 | if out is None: |
| 4936 | d = self.filled(True).all(axis=axis, **kwargs).view(type(self)) |
| 4937 | if d.ndim: |
| 4938 | d.__setmask__(mask) |
| 4939 | elif mask: |
| 4940 | return masked |
| 4941 | return d |
| 4942 | self.filled(True).all(axis=axis, out=out, **kwargs) |
| 4943 | if isinstance(out, MaskedArray): |
| 4944 | if out.ndim or mask: |
| 4945 | out.__setmask__(mask) |
| 4946 | return out |
| 4947 | |
| 4948 | def any(self, axis=None, out=None, keepdims=np._NoValue): |
| 4949 | """ |