On Wed, Aug 25, 2021 at 5:39 PM Finn Mason <finnjavier08@gmail.com> wrote:
Or the NaNs could be treated as zeros and a warning raised:

Absolutely not! NaN in no way means zero, ever. We should never provide a known incorrect result.
 
I do feel there should be a catchable warning but not an outright exception, and a non-NaN value should still be returned.

I disagree -- warnings are way too easy to ignore. Give people a way to opt-in to silent NaN handling, but don't rely on a warning to let people know they need to think about it.

In any case, the current behavior should definitely be changed.

I think we all agree on that !

-CHB

--
Christopher Barker, PhD (Chris)

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython