{ } Raw JSON

bundles / numpy 2.4.4 / numpy / matrixlib / defmatrix / matrix / all

function

numpy.matrixlib.defmatrix:matrix.all

source: /numpy/matrixlib/defmatrix.py:579

Signature

def all(self, axis = None, out = None)

Summary

Test whether all matrix elements along a given axis evaluate to True.

Parameters

See `numpy.all` for complete descriptions

Notes

This is the same as ndarray.all, but it returns a matrix object.

Examples

x = np.matrix(np.arange(12).reshape((3,4))); x
y = x[0]; y
(x == y)
✓
matrix([[ True,  True,  True,  True],
        [False, False, False, False],
        [False, False, False, False]])
(x == y).all()
✗
np.False_
(x == y).all(0)
(x == y).all(1)
✓
matrix([[ True],
        [False],
        [False]])

See also

numpy.all

Aliases

  • numpy.matrix.all