[SciPy-user] Sort 3-D arrays by two columns

Tom Denniston tom.denniston@alum.dartmouth....
Wed Mar 14 16:11:42 CDT 2007


I think you want lexsort.  It takes a tuple of columns.

On 3/14/07, Bill Baxter <wbaxter@gmail.com> wrote:
> Does lexsort  do what you need?
>
> Also, have you seen the numpy examples list?  It's a good place to
> look for this sort of thing:
> http://www.scipy.org/Numpy_Example_List
> http://www.scipy.org/Numpy_Example_List_With_Doc
>
> --bb
>
> On 3/14/07, Thomas Nauss <nauss@lcrs.de> wrote:
> > Dear Experts,
> > I want plot some satellite datasets using matplotlib with basemap. For
> > that task, I need a 3-D array (or three 1-D arrays) containing latitude,
> > longitude, and corresponding data values. Since basemap needs latitude
> > and longitude values in increasing order, I'm looking for a function to
> > sort the 3-D array by the two lat/lon columns (i.e. first by latitude,
> > then by longitude but conserving the value combinations).
> > Thanks,
> > Thomas
> >
> > _______________________________________________
> > SciPy-user mailing list
> > SciPy-user@scipy.org
> > http://projects.scipy.org/mailman/listinfo/scipy-user
> >
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>


More information about the SciPy-user mailing list