MCPcopy Create free account
hub / github.com/numpy/numpy / all

Method all

numpy/ma/core.py:4908–4946  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 15

testScaleMethod · 0.45
testLUSplitMethod · 0.45
testViewMethod · 0.45
testViewMethod · 0.45
testScaleMethod · 0.45
testLUSplitMethod · 0.45
testReverseMethod · 0.45
testEOSplitMethod · 0.45
testTwosMethod · 0.45
testThreesMethod · 0.45
testScaleMethod · 0.45
testLUSplitMethod · 0.45

Calls 4

filledMethod · 0.95
_check_mask_axisFunction · 0.85
__setmask__Method · 0.80
viewMethod · 0.45

Tested by 15

testScaleMethod · 0.36
testLUSplitMethod · 0.36
testViewMethod · 0.36
testViewMethod · 0.36
testScaleMethod · 0.36
testLUSplitMethod · 0.36
testReverseMethod · 0.36
testEOSplitMethod · 0.36
testTwosMethod · 0.36
testThreesMethod · 0.36
testScaleMethod · 0.36
testLUSplitMethod · 0.36