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

Method all

numpy/matrixlib/defmatrix.py:572–610  ·  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

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

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