Skip to content

np.testing.assert_array_equal prints "[repr failed]" on some matrices #5875

Closed

Description

@bmerry

With numpy 1.9.2 on Ubuntu 14.04 with Python 2.7:

>>> np.testing.assert_array_equal(np.matrix([[2, 1]]), np.matrix([[1, 2]])) 
...

AssertionError: 

Arrays are not equal
(mismatch 100.0%)
 x: [repr failed]
 y: [repr failed]

It seems that 1x1 matrices work, and changing np.matrix to np.array works. Also, manually calling repr on the matrix works.

Activity

  1. eric-wieser commented on Nov 28, 2017

    @eric-wieser
    Member

    Caused by #8442, which has a few more comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions