sort array, apply rearrangement to second

Chris Colbert sccolbert at gmail.com
Tue Mar 30 21:59:32 EDT 2010


On Tue, Mar 30, 2010 at 7:25 PM, Victor Eijkhout <see at sig.for.address>wrote:

> I have two arrays, made with numpy. The first one has values that I want
> to use as sorting keys; the second one needs to be sorted by those keys.
> Obviously I could turn them into a dictionary  of pairs and sort by the
> first member, but I think that's not very efficient, at least in space,
> and this needs to be done as efficiently as possible.
>
> I could use a hand.
>
> Victor.
> --
> Victor Eijkhout -- eijkhout at tacc utexas edu
> --
> http://mail.python.org/mailman/listinfo/python-list
>


I'm not quite sure what you are asking, but there is probably an efficient
way to do it in pure numpy. You can either post an example of what you want
here, or better, take it to the NumPy mailing list and I will help you
there.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100330/f90e2dfb/attachment-0001.html>


More information about the Python-list mailing list