sort array, apply rearrangement to second
sccolbert at gmail.com
Wed Mar 31 04:11:41 CEST 2010
On Tue, Mar 30, 2010 at 9:59 PM, Chris Colbert <sccolbert at gmail.com> wrote:
> 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 Eijkhout -- eijkhout at tacc utexas edu
> 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
This seems to be what you want:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list