MCPcopy
hub / github.com/numpy/numpy / all

Method all

numpy/ma/core.py:4978–5017  ·  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

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

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