[Numpy-discussion] proposal: min, max of complex should give warning

Cera, Tim tim at cerazone.net
Tue Dec 31 08:51:52 EST 2013

I don't work with complex numbers, but just sampling what others do:

Python: no ordering, results in TypeError

Matlab: sorts by magnitude

R: sorts first by real, then by imaginary

Numpy: sorts first by real, then by imaginary (the documentation link
below calls this sort 'lexicographical' which I don't think is

I would think that the Matlab sort might be more useful, but easy
enough by using the absolute value.

I think what Numpy does is normal enough to not justify a warning, but
leave this to others because as I pointed out in the beginning I don't
work with complex numbers.

Kindest regards,

More information about the NumPy-Discussion mailing list