Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread David Goldsmith
In reply to your reply (which I inadvertently deleted :-[ ) to my reply: Point well-made and taken. :-) DG Stuart Brorson wrote: >> No. It is a matter of sorting first on the real part, and then resolving >> duplicates by sorting on the imaginary part. The magnitude is not used: >> > [sni

Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread Stuart Brorson
On Fri, 21 Sep 2007, David Goldsmith wrote: > Not to be snide, but I found this thread very "entertaining," as, > precisely because there is no single, well-defined (partial) ordering of > C, I regard it as poor coding practice to rely on whatever partial > ordering the language you're using may (

Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread David Goldsmith
Apparently so. Not to be snide, but I found this thread very "entertaining," as, precisely because there is no single, well-defined (partial) ordering of C, I regard it as poor coding practice to rely on whatever partial ordering the language you're using may (IMO unwisely) provide: if you wan

Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread Stuart Brorson
> No. It is a matter of sorting first on the real part, and then resolving > duplicates by sorting on the imaginary part. The magnitude is not used: [snip] Oh, OK. So the ordering algorithm for complex numbers is: 1. First sort on real part. 2. Then sort on imag part. Right? Stuart

Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread Gael Varoquaux
On Fri, Sep 21, 2007 at 08:27:51PM -0400, Stuart Brorson wrote: >>>> a >array([[ 1. +1.j , 1. +2.j ], > [ 2. +1.j , 1.9+1.9j]]) >>>> numpy.max(a) >(2+1j) This is numpy. You are dealing with arrays, so its numpy. >>>> a = 2+1j >>>> b = 2+2j >>>> a>b >Tra

Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread Eric Firing
Stuart Brorson wrote: > On Fri, 21 Sep 2007, Robert Kern wrote: >> Stuart Brorson wrote: > Is it NumPy's goal to be as compatible with Matlab as possible? No. >>> OK, so that's fair enough. But how about self-consistency? >>> I was thinking about this issue as I was biking home this eveni

Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread Stuart Brorson
>> Is it NumPy's goal to be as compatible with Matlab as possible? > > No. OK, so that's fair enough. But how about self-consistency? I was thinking about this issue as I was biking home this evening. To review my question: >>> a array([[ 1. +1.j , 1. +2.j ], [ 2. +1.j , 1.9+1

Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread Robert Kern
Stuart Brorson wrote: >>> Is it NumPy's goal to be as compatible with Matlab as possible? >> No. > > OK, so that's fair enough. But how about self-consistency? > I was thinking about this issue as I was biking home this evening. > > To review my question: > >>>> a >array([[ 1. +1.j , 1

Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread Stuart Brorson
On Fri, 21 Sep 2007, Robert Kern wrote: > Stuart Brorson wrote: Is it NumPy's goal to be as compatible with Matlab as possible? >>> No. >> >> OK, so that's fair enough. But how about self-consistency? >> I was thinking about this issue as I was biking home this evening. >> >> To review my que

Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread Christopher Barker
Stuart Brorson wrote: > Is it NumPy's goal to be as compatible with Matlab as possible? No. Whatever gave you that idea? That's what Octave is for. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Wa

Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread Robert Kern
Stuart Brorson wrote: > Thank you for your answer! > >>> As a NumPy newbie, I am still learning things about NumPy which I didn't >>> expect. Today I learned that for a matrix of complex numbers, >>> numpy.max() returns the element with the largest *real* part, not the >>> element with the larges

Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread Stuart Brorson
Thank you for your answer! >> As a NumPy newbie, I am still learning things about NumPy which I didn't >> expect. Today I learned that for a matrix of complex numbers, >> numpy.max() returns the element with the largest *real* part, not the >> element with the largest *magnitude*. > > There isn't

Re: [Numpy-discussion] Question about numpy.max()

2007-09-21 Thread Robert Kern
Stuart Brorson wrote: > Hi guys, > > As a NumPy newbie, I am still learning things about NumPy which I didn't > expect. Today I learned that for a matrix of complex numbers, > numpy.max() returns the element with the largest *real* part, not the > element with the largest *magnitude*. There isn'

[Numpy-discussion] Question about numpy.max()

2007-09-21 Thread Stuart Brorson
Hi guys, As a NumPy newbie, I am still learning things about NumPy which I didn't expect. Today I learned that for a matrix of complex numbers, numpy.max() returns the element with the largest *real* part, not the element with the largest *magnitude*. Is this the desired behavior? Here's an exa