<br><br><div class="gmail_quote">On Tue, Mar 30, 2010 at 9:59 PM, Chris Colbert <span dir="ltr"><<a href="mailto:sccolbert@gmail.com">sccolbert@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Tue, Mar 30, 2010 at 7:25 PM, Victor Eijkhout <span dir="ltr"><see@sig.for.address></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have two arrays, made with numpy. The first one has values that I want<br>
to use as sorting keys; the second one needs to be sorted by those keys.<br>
Obviously I could turn them into a dictionary of pairs and sort by the<br>
first member, but I think that's not very efficient, at least in space,<br>
and this needs to be done as efficiently as possible.<br>
<br>
I could use a hand.<br>
<br>
Victor.<br>
<font color="#888888">--<br>
Victor Eijkhout -- eijkhout at tacc utexas edu<br>
</font><div><div></div><div>--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a></div></div></blockquote><div><br></div><div><br></div></div></div><div>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. </div>
</div><br></blockquote><div><br></div><div>This seems to be what you want:</div><div><br></div><div><a href="http://stackoverflow.com/questions/1903462/how-can-i-zip-sort-parallel-numpy-arrays">http://stackoverflow.com/questions/1903462/how-can-i-zip-sort-parallel-numpy-arrays</a> </div>
</div><br>