[Numpy-discussion] [ANN] Nanny, faster NaN functions

Keith Goodman kwgoodman@gmail....
Fri Nov 19 23:29:16 CST 2010

On Fri, Nov 19, 2010 at 8:33 PM,  <josef.pktd@gmail.com> wrote:

>>>> -np.inf>-np.inf
> False
> If the only value is -np.inf, you will return nan, I guess.
>>>> np.nanmax([-np.inf, np.nan])
> -inf

That's a great corner case. Thanks, Josef. This looks like it would fix it:


if ai > amax:
    amax = ai


if ai >= amax:
    amax = ai

More information about the NumPy-Discussion mailing list