[SciPy-User] sorting an array

Martin mdekauwe at gmail.com
Sun Aug 2 09:11:05 EDT 2009


Apologies Neil! Your solution was in fact exactly what I wanted...I
don't know why I said otherwise yesterday (tiredness). As you said
what I wanted to do was to sort by the first and then second cols,
moving the third and fourth columns to their respective places. What I
didn't want was for these cols(3 and 4) to also be numerically sorted.

I am trying it now.

Thanks



On Aug 2, 9:43 am, Neil Crighton <neilcrigh... at gmail.com> wrote:
> Martin <mdekauwe <at> gmail.com> writes:
>
> > Hi all,
>
> > Thanks for the replies...perhaps if I explained the context it might
> > help (or it might not!). Basically it is an image processing problem
> > so the array is rows, columns. So I want to sort the array such that
> > ...
> > Neil your solution results in column 4 changing some of the ordering
> > from what I can see (the zero in the fourth column).
>
> I think I see now - you want the values in the third and fourth columns to be
> unchanged after sorting?  Then, yeah, I think Emmanuelle's version is the
> way to go.
>
> I was confused by the first sentence in your original post. To me, 'sort an
> array by the first column' means sort every column using the ordering of
> values in the first column.
>
> Neil
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-U... at scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-User mailing list