[PYTHON MATRIX-SIG] Standard Numerical Library

Janne Sinkkonen janne@avocado.pc.helsinki.fi
11 Aug 1996 00:41:01 +0300

Carlos Fonseca <fonseca@gaivota.demon.co.uk> writes:

> I find functions like max(), min(), and sort() (fun() for short)  more
> limited than the corresponding argfun(), simply because the former could
> always be writen as take(a,argfun(a)).

I agree... it is complex to compute the index from the value, the
other way it's much easier.

argsort() solves my problem, at least less suboptimally than some
other hacks. In 1.0 alpha1 there seems to be some kind of type
conversion missing from argsort(), however:

>>> argsort([5,4,2,3])
2 3 1 0
>>> argsort([5.0,4,2,3])
  6.36598737e-314   4.94065646e-324   0.00000000e+000   0.00000000e+000


MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org