
On Wed, Aug 25, 2021 at 10:40:59PM -0700, Christopher Barker wrote:
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 agree that NANs should not be replaced by zero. If the user wants to replace NANs with some constant, they can filter and replace the data themselves.
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.
Such a warning would be opt-in. If someone chooses to ignore the warnings that they explicitly asked to receive, that's not our problem :-) I think it would be useful to say "ignore NANs, but give me a warning if you do". That gives a meaningful result (treating NANs as if they were missing data) while still alerting the user to the fact that they had missing data and might want to find out why. -- Steve