numarray newbie

Hi,

This is more of a numarray issue, but also relevant here I hope. I
wonder how you sort a numarray.array descending? I know
numarray.sort(array) sort ascending.

thx

"numarray.sort(array)[-1::-1]" should work for reversing the list fairly fast.
That indexing btw means start at the last item, and use a stride of -1.

···

On 2/6/06, Elderly Geek <epost2@...287...> wrote:

Hi,

This is more of a numarray issue, but also relevant here I hope. I
wonder how you sort a numarray.array descending? I know
numarray.sort(array) sort ascending.

thx

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

There is a special mailing list for this sort of question (numpy-discussion@lists.sourceforge.net). There are a number of ways one can do this but why not either reverse the sorted array (or the sorted indices) by using strides, e.g., get the sorted array and then refer to it as sarr[::-1]?

Perry Greenfield

···

On Feb 6, 2006, at 8:57 AM, Elderly Geek wrote:

Hi,

This is more of a numarray issue, but also relevant here I hope. I
wonder how you sort a numarray.array descending? I know
numarray.sort(array) sort ascending.

thx

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options