On Wed, Aug 25, 2021 at 10:40:59PM -0700, Christopher Barker wrote: > On Wed, Aug 25, 2021 at 5:39 PM Finn Mason <finnjavie...@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 _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/L324EIKHNJBHEI4VBLGTA4ODIXZVRFR3/ Code of Conduct: http://python.org/psf/codeofconduct/