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

Charles R Harris charlesr.harris at gmail.com
Sun Oct 29 21:17:34 EST 2006


On 10/29/06, Tom Denniston <tom.denniston at alum.dartmouth.org> 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.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20061029/973b59b8/attachment.html>
-------------- 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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-------------- next part --------------
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


More information about the NumPy-Discussion mailing list