[Numpy-discussion] Question about numpy.max(<complex matrix>)

Stuart Brorson sdb@cloud9....
Fri Sep 21 15:47:00 CDT 2007


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 a single, well-defined (partial) ordering of complex numbers. Both
> the lexicographical ordering (numpy) and the magnitude (Matlab) are useful

[... snip ...]

Yeah, I know this.  In fact, one can think of zillions of way to
induce an ordering on the complex numbers, like Hamming distance,
ordering via size of imaginary component, etc.  And each might have
some advantages in a particular problem domain.

Therefore, perhaps I need to refocus, or perhaps sharpen my question:
Is it NumPy's goal to be as compatible with Matlab as possible?  Or
when questions of mathematical ambiguity arise (like how to order a
sequence of complex numbers), does NumPy chose its own way?

Cheers,

Stuart


More information about the Numpy-discussion mailing list