[Numpy-discussion] Should array_equal work with non-numeric types?

Christopher Barker Chris.Barker@noaa....
Fri Mar 2 15:10:53 CST 2007

Hi all,

Should array_equal work with non-numeric types?

 >>> a
array(['a', 'b', 'c', 'd', 'e', 'f', 'g'],
 >>> b = a.copy()
 >>> a == b
array([True, True, True, True, True, True, True], dtype=bool)
 >>> numpy.array_equal(a,b)
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
line 652, in array_equal
     return logical_and.reduce(equal(a1,a2).ravel())
AttributeError: 'NotImplementedType' object has no attribute 'ravel'

I can use:
 >>> numpy.all(a==b)

But I was wondering if array_equal should work.


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception


More information about the Numpy-discussion mailing list