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