Re: [Numpy-discussion] sorting ndarray

2008-04-04 Thread Nils Wagner
On Thu, 3 Apr 2008 23:02:24 -0700 (PDT) harryos <[EMAIL PROTECTED]> wrote: > i have a 1 dim numpy array > D=array( [[ 3. , 2. , 1. , 4. , 5. , 1.5, 2.2]] ) > i need to get this sorted in descending order and then >access the > elements . > D.sort() will make D as [[ 1. 1.5 2. 2.2 3.

Re: [Numpy-discussion] sorting ndarray

2008-04-03 Thread Eric Firing
harryos wrote: > i have a 1 dim numpy array > D=array( [[ 3. , 2. , 1. , 4. , 5. , 1.5, 2.2]] ) This is a 2-D array, not a 1-D array. > i need to get this sorted in descending order and then access the > elements . > D.sort() will make D as [[ 1. 1.5 2. 2.2 3. 4. 5. ]] > how will

[Numpy-discussion] sorting ndarray

2008-04-03 Thread harryos
i have a 1 dim numpy array D=array( [[ 3. , 2. , 1. , 4. , 5. , 1.5, 2.2]] ) i need to get this sorted in descending order and then access the elements . D.sort() will make D as [[ 1. 1.5 2. 2.2 3. 4. 5. ]] how will i reverse it? or is there a simpler way? harry