[Tutor] Elegant argument index sort

Dinesh B Vadhia dineshbvadhia at hotmail.com
Wed Nov 7 23:41:24 CET 2007


I'm sorting a 1-d (NumPy) matrix array (a) and wanting the index results (b).  This is what I have:

b = a.argsort(0)
b = b+1

The one (1) is added to b so that there isn't a zero index element.  Is there a more elegant way to do this?

Dinesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071107/35de0af1/attachment.htm 


More information about the Tutor mailing list