Strange numpy.argmax behavior on object arrays in numpy 1.0.

Charles R Harris charlesr.harris at
Sun Oct 29 20:17:34 CST 2006

On 10/29/06, Tom Denniston <tom.denniston at> wrote:
> Oh.  My mistake. I thought I had an array of 2 objects which were ints.  I
> actually had an array of one list of 2 ints.  It works properly if I
> construct the array properly.

I think there is actually a bug here:

In [61]: sort(array([3,2], dtype=object))
Out[61]: array([2, 3], dtype=object)

In [62]: argmax(array([2,3], dtype=object))
Out[62]: 0

See, the sort works fine. I suspect argmax is using the wrong comparison
function. I was just pointing out that sometimes it is hard to know what is
going on with objects.

-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
-------------- next part --------------
Numpy-discussion mailing list
Numpy-discussion at

More information about the Numpy-discussion mailing list