MCPcopy Index your code
hub / github.com/numpy/numpy / all

Method all

numpy/matrixlib/defmatrix.py:577–615  ·  view source on GitHub ↗

Test whether all matrix elements along a given axis evaluate to True. Parameters ---------- See `numpy.all` for complete descriptions See Also -------- numpy.all Notes ----- This is the same as `ndarray.all`, but it

(self, axis=None, out=None)

Source from the content-addressed store, hash-verified

575 return N.ndarray.any(self, axis, out, keepdims=True)._collapse(axis)
576
577 def all(self, axis=None, out=None):
578 """
579 Test whether all matrix elements along a given axis evaluate to True.
580
581 Parameters
582 ----------
583 See `numpy.all` for complete descriptions
584
585 See Also
586 --------
587 numpy.all
588
589 Notes
590 -----
591 This is the same as `ndarray.all`, but it returns a `matrix` object.
592
593 Examples
594 --------
595 >>> x = np.matrix(np.arange(12).reshape((3,4))); x
596 matrix([[ 0, 1, 2, 3],
597 [ 4, 5, 6, 7],
598 [ 8, 9, 10, 11]])
599 >>> y = x[0]; y
600 matrix([[0, 1, 2, 3]])
601 >>> (x == y)
602 matrix([[ True, True, True, True],
603 [False, False, False, False],
604 [False, False, False, False]])
605 >>> (x == y).all()
606 False
607 >>> (x == y).all(0)
608 matrix([[False, False, False, False]])
609 >>> (x == y).all(1)
610 matrix([[ True],
611 [False],
612 [False]])
613
614 """
615 return N.ndarray.all(self, axis, out, keepdims=True)._collapse(axis)
616
617 def max(self, axis=None, out=None):
618 """

Callers 8

test_flatMethod · 0.45
test_basicMethod · 0.45
test_ptpMethod · 0.45
test_basicMethod · 0.45
test_comparisonsMethod · 0.45
test_basicMethod · 0.45

Calls 1

_collapseMethod · 0.80

Tested by 8

test_flatMethod · 0.36
test_basicMethod · 0.36
test_ptpMethod · 0.36
test_basicMethod · 0.36
test_comparisonsMethod · 0.36
test_basicMethod · 0.36