[Numpy-discussion] Deprecate np.max/np.min ?
Fri Nov 6 12:22:59 CST 2009
pe, 2009-11-06 kello 12:57 -0500, firstname.lastname@example.org kirjoitti:
> It follows the same pattern for missing brackets as many of the other
> functions, where I often have typos.
> >>> np.min(3,2)
> >>> np.sum(3,2)
> >>> np.ones(3,2)
I think you are thinking about Matlab now...
The issue here is that Numpy's `min` and `max`, if used like their
Python counterparts, give surprising results. `sum`, `ones`, `round`,
etc. don't have this problem. The prepended `a` in the beginning is IMO
not a big price to pay for reduced overloading.
OTOH, one can ask, why is
gives "ValueError: axis(=2) out of bounds". It seems to me that
0-dimensional objects should accept only None as the axis? (Fixing this
would also make misuse of np.min and np.max more difficult.)
More information about the NumPy-Discussion