[Numpy-discussion] Deprecate np.max/np.min ?

Pauli Virtanen pav@iki...
Sat Nov 7 15:41:20 CST 2009


la, 2009-11-07 kello 18:27 +0000, Neil Crighton kirjoitti:
[clip]
> I think it would be better to fix this issue.  np.min(3,2) should also give
> "ValueError: axis(=2) out of bounds". Fixing this also removes any possibility
> of generating hard-to-find errors by overwriting the builtin min/max. (Unless
> there's some corner case I'm missing).

Fixed in r7697, r7698, which change the behavior of scalars in many
functions using axis=xxx.

I don't think this breaks anyone's code -- using out-of-bounds values of
axis is almost certainly an error.

I left axis=-1 and axis=0 allowed, in addition to axis=None. These
seemed to be required by at least the masked arrays unit tests...

-- 
Pauli Virtanen





More information about the NumPy-Discussion mailing list