Note that numpy has a set of nan* functions that ignore NaNs.

I’m not suggesting that here, but it is prior art to be considered, and I
do like that it explicitly is ignoring NaNs.




> - raise an exception
>
> - return NAN
>
> - ignore it (filter out NANs)
>
> Does anyone have any strong feelings about what should be the default?


Filtering our NaNs should *not* be the default. Often NaN means missing
data, but could also be the result of an error of some sort.  Incorrect
results are much worse than errors — NaNs should never be ignored unless
explicitly asked for.

Beyond that, I’d prefer returning NaN to raising an exception, but either
is OK.

-CHB




>
>
> --
> Steve
> _______________________________________________
> Python-ideas mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/[email protected]/message/EDRF2NR4UOYMSKE64KDI2SWUMKPAJ3YM/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-- 
Christopher Barker, PhD (Chris)

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/UK2WTSMEGH5TYH3XMS74B2NKSXID3Q4S/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to