[PYTHON MATRIX-SIG] Final conventions for alpha2
Carlos Fonseca
fonseca@gaivota.demon.co.uk
Sun, 18 Aug 1996 22:09:04 +0100 (BST)
On Sun, 18 Aug 1996, Jim Hugunin wrote:
> Carlos Fonseca wrote:
>
> > ix=argsort(a)
> > A=take(a,ix)
> > B=take(b,ix)
> >
> > This should be enough.
>
> You have a good point here, but I think that the issue is you want a
> different function from Konrad. Alright, writing functions is something
> I can do. What would you like it to be called?
How do you feel about index(a,indices,axis). Alternatively, select(...)
would also make sense, I think. Thanks for looking into this.
> > My experience is different. But Matlab doesn't let me write something
> > like the above even for 2d arrays, so I end up using a for-loop.
>
> So at least we aren't in danger of having you defect back to matlab :)
:-)
> > Something else:
> >
> > How can I achieve
> >
> > rank = argsort(argsort(cost))
> <
> > without having to call argsort twice? Something like an inverted take
> > (ekat below :-)
>
> I see what you're looking for here, but I'm not convinced that having to
> call argsort twice is enough of a burden to justify the function you're
> asking for. I'd either like to see more examples of how this would be
> useful, or have you wait and ask for this in version 1.1.
Plain indexing should always be more efficient than sorting, but this is
certainly not a problem for me at the moment. I agree that there is
more than enough to concentrate on until v1.0.
Carlos
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================