Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.matrix.all

matrix.all(axis=None,out=None)[source]

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 asndarray.all, but it returns amatrix object.

Examples

>>>x=np.matrix(np.arange(12).reshape((3,4)));xmatrix([[ 0,  1,  2,  3],        [ 4,  5,  6,  7],        [ 8,  9, 10, 11]])>>>y=x[0];ymatrix([[0, 1, 2, 3]])>>>(x==y)matrix([[ True,  True,  True,  True],        [False, False, False, False],        [False, False, False, False]], dtype=bool)>>>(x==y).all()False>>>(x==y).all(0)matrix([[False, False, False, False]], dtype=bool)>>>(x==y).all(1)matrix([[ True],        [False],        [False]], dtype=bool)

Previous topic

numpy.matrix.strides

Next topic

numpy.matrix.any

  • © Copyright 2008-2009, The Scipy community.
  • Last updated on Jun 10, 2017.
  • Created usingSphinx 1.5.3.

[8]ページ先頭

©2009-2025 Movatter.jp