[Numpy-discussion] RE: default axis for numarray

Perry Greenfield perry at stsci.edu
Tue Jun 11 11:53:02 EDT 2002

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


More information about the NumPy-Discussion mailing list