[Numpy-discussion] RE: default axis for numarray

Scott Ransom ransom at physics.mcgill.ca
Tue Jun 11 14:08:05 EDT 2002


On June 11, 2002 04:56 pm, you wrote:
> One can make a case for allowing == and != for complex arrays, but >
> just doesn't make sense and should not be allowed.

It depends if you think of complex numbers in phasor form or not.  In phasor 
form, the amplitude of the complex number is certainly something that you 
could compare with > or < -- and in my opinion, that seems like a reasonable 
comparison.  You _could_ do the same thing with the phases, except you run 
into the modulo 2pi thing...

Scott

> > -----Original Message-----
> > From: numpy-discussion-admin at lists.sourceforge.net
> > [mailto:numpy-discussion-admin at lists.sourceforge.net] On
> > Behalf Of Perry Greenfield
> > Sent: Tuesday, June 11, 2002 11:52 AM
> > To: eric jones; 'Konrad Hinsen'
> > Cc: numpy-discussion at lists.sourceforge.net
> > Subject: RE: [Numpy-discussion] RE: default axis for numarray
> >
> >
> > <Eric Jones writes>:
> >
> >    <Konrad Hinsen writes>:
> > > > What needs to be improved in that area?
> > >
> > > Comparisons of complex numbers.  But lets save that debate
> >
> > for later.
> >
> >
> > No, no, let's do it now. ;-) We for one would like to know for
> > numarray what should be done.
> >
> > If I might be presumptious enough to anticipate what Eric
> > would say, it is that complex comparisons should be allowed,
> > and that they use all the information in the complex number
> > (real and imaginary) so that they lead to consistent results
> > in sorting.
> >
> > But the purist argues that comparisons for complex numbers
> > are meaningless. Well, yes, but there are cases in code where you
> > don't which such comparisons to cause an exception. But even
> > more important, there is at least one case which is
> > practical. It isn't all that uncommon to want to eliminate
> > duplicate values from arrays, and one would like to be able
> > to do that for
> > complex values as well. A common technique is to sort the
> > values and then eliminate all identical adjacent values. A
> > predictable comparison rule would allow that to be easily implemented.
> >
> > Eric, am I missing anything in this? It should be obvious
> > that we agree with his position, but I am wondering if there
> > are any arguments we have not heard yet that outweigh the
> > advantages we see.
> >
> > Perry
> >
> > _______________________________________________________________
> >
> > Multimillion Dollar Computer Inventory
> > Live Webcast Auctions Thru Aug. 2002 -
> > http://www.cowanalexander.com/calendar
> >
> >
> >
> >
> > _______________________________________________
> > Numpy-discussion mailing list Numpy-discussion at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>
> _______________________________________________________________
>
> Multimillion Dollar Computer Inventory
> Live Webcast Auctions Thru Aug. 2002 -
> http://www.cowanalexander.com/calendar
>
>
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion

-- 
Scott M. Ransom              Address:  McGill Univ. Physics Dept.
Phone:  (514) 398-6492                 3600 University St., Rm 338
email:  ransom at physics.mcgill.ca       Montreal, QC  Canada H3A 2T8 
GPG Fingerprint: 06A9 9553 78BE 16DB 407B  FFCA 9BFA B6FF FFD3 2989




More information about the NumPy-Discussion mailing list