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

Pierre GM pgmdevlist@gmail....
Fri Mar 2 15:58:37 CST 2007


On Friday 02 March 2007 16:10:53 Christopher Barker wrote:
> Hi all,
>
> Should array_equal work with non-numeric types?

I'm all for that. I was regularly running into that problem when comparing 
object arrays or chararrays, that's why I modified assert_equal in 
the "maskedarray" version of testutils (scipy SVN). 
>>>from maskedarray.testutils import assert_equal
>>>a = N.array(['a','b','c'])
>>>assert_equal(a,a.copy())
>>>assert_equal(a,a[::-1])
AssertionError:
Items are not equal:
item=0

 ACTUAL: 'a'
 DESIRED: 'c'


More information about the Numpy-discussion mailing list