[Numpy-discussion] Are "min", "max" documented for scalars?

Edward C. Jones edcjones at comcast.net
Wed Jun 6 22:17:32 EDT 2012


Python "max" and "min" have an interesting and _useful_ behavior when
applied to numpy scalars and Python numbers.  Here is a piece of
pseudo-code:

def max(a, b):
     if int(b) > int(a):
         return b
     else:
         return a

The larger object is returned unchanged.  If the two objects are equal,
return the first unchanged.

Is the behavior of "max", "min", "<", "<=", etc. for numpy scalar objects
documented somewhere?

keywords: greater than less than




More information about the NumPy-Discussion mailing list