[Numpy-discussion] np.min(np.inf,1000) == np.inf

Robert Kern robert.kern@gmail....
Tue Sep 23 16:05:11 CDT 2008


On Tue, Sep 23, 2008 at 15:34, joep <josef.pktd@gmail.com> wrote:
> I just fell over this:
>
>>>> np.min(np.inf,1000)
> 1.#INF
>>>> min(np.inf,1000)
> 1000
>
>>>> np.max(-np.inf,1000)
> -1.#INF
>>>> max(-np.inf,1000)
> 1000
>
> Is this known behavior?

It is known that that's not the API of numpy.min(). It probably should
raise an exception since 1000 is not a valid axis for a rank-0 array
(which is what the first argument gets turned into under the covers).

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco


More information about the Numpy-discussion mailing list