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

Keith Goodman kwgoodman at gmail.com
Sat Nov 20 00:29:16 EST 2010


On Fri, Nov 19, 2010 at 8:33 PM,  <josef.pktd at 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:

change

if ai > amax:
    amax = ai

to

if ai >= amax:
    amax = ai



More information about the NumPy-Discussion mailing list