Re: [Numpy-discussion] is there a sortrows

2008-12-21 Thread josef . pktd
On Sun, Dec 21, 2008 at 11:37 PM, wrote: > On Sun, Dec 21, 2008 at 11:10 PM, Pierre GM wrote: >> >> On Dec 21, 2008, at 10:19 PM, josef.p...@gmail.com wrote: >>> From the examples that I tried out np.sort, sorts each column >>> separately (with axis = 0). If the elements of a row is suppose

Re: [Numpy-discussion] is there a sortrows

2008-12-21 Thread josef . pktd
On Sun, Dec 21, 2008 at 11:10 PM, Pierre GM wrote: > > On Dec 21, 2008, at 10:19 PM, josef.p...@gmail.com wrote: >> >>> From the examples that I tried out np.sort, sorts each column >> separately (with axis = 0). If the elements of a row is supposed to >> stay together, then np.sort doesn't work >

Re: [Numpy-discussion] is there a sortrows

2008-12-21 Thread Pierre GM
On Dec 21, 2008, at 10:19 PM, josef.p...@gmail.com wrote: > >> From the examples that I tried out np.sort, sorts each column > separately (with axis = 0). If the elements of a row is supposed to > stay together, then np.sort doesn't work Well, if the elements are supposed to stay together, why wo

Re: [Numpy-discussion] is there a sortrows

2008-12-21 Thread David Cournapeau
josef.p...@gmail.com wrote: >> I may miss something obvious, but why are you using lexsort at all ? At >> leat, the first example is easily achieved with sort(x, axis=0) - but >> maybe you have more complicated examples in mind where you need actual >> lexical sort: >> >> David >> > > >From th

Re: [Numpy-discussion] is there a sortrows

2008-12-21 Thread josef . pktd
> > I may miss something obvious, but why are you using lexsort at all ? At > leat, the first example is easily achieved with sort(x, axis=0) - but > maybe you have more complicated examples in mind where you need actual > lexical sort: > > David >From the examples that I tried out np.sort, sorts

Re: [Numpy-discussion] is there a sortrows

2008-12-21 Thread Robert Kern
On Sun, Dec 21, 2008 at 20:53, David Cournapeau wrote: > josef.p...@gmail.com wrote: >> I was looking for a function that sorts a 2-dimensional array by rows. >> That's what I came up with, is there a more direct way? >> > a >> array([[1, 2], >>[0, 0], >>[1, 0], >>[0, 2

Re: [Numpy-discussion] is there a sortrows

2008-12-21 Thread David Cournapeau
josef.p...@gmail.com wrote: > I was looking for a function that sorts a 2-dimensional array by rows. > That's what I came up with, is there a more direct way? > a > array([[1, 2], >[0, 0], >[1, 0], >[0, 2], >[2, 1], >[1, 0], >[1, 0], >[0,

[Numpy-discussion] is there a sortrows

2008-12-21 Thread josef . pktd
I was looking for a function that sorts a 2-dimensional array by rows. That's what I came up with, is there a more direct way? >>> a array([[1, 2], [0, 0], [1, 0], [0, 2], [2, 1], [1, 0], [1, 0], [0, 0], [1, 0], [2, 2]]) >>> a[np.lexso