[Numpy-discussion] min bug
Tue Nov 17 03:47:43 CST 2009
Alan McIntyre <alan.mcintyre <at> gmail.com> writes:
> On Mon, Nov 16, 2009 at 11:34 PM, "V. Armando Solé" <sole <at> esrf.fr> wrote:
> > Sebastian Berg wrote:
> >> Known issue, I think someone posted about it a while ago too. The numpy
> >> min is array aware, and it expects an array. The second argument is the
> >> axis, which in the case of a single number doesn't matter.
> > I think I have to agree with the original poster.
> > It would be more correct to rise an exception because the axis is beyond
> > the number of axes than to return a confusing result.
> Hm, now that I actually try my example
> min((5000,), 4)
> it fails with an axis out of bounds error. I presume there's a reason
> why a 0-D array gets special treatment?
In : import numpy as np
In : np.__version__
In : np.min(5000, 4)
ValueError: axis(=4) out of bounds
More information about the NumPy-Discussion