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
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
>
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
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
>
> 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
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
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,
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