On Mon, Dec 30, 2019 at 06:10:37PM +1100, Chris Angelico wrote:

> But the question is: What should the statistics module do with a nan?
> This can only be answered by understanding what "nan" means in a
> statistical context, which is only tangentially related to the
> question of whether nan is a number. And I think this thread has
> proven that there is no single obvious meaning for a nan. It could
> mean missing data. It could mean out-of-bounds or illogical data. It
> could mean something different entirely.

Indeed, NANs can mean missing data, or the results of an invalid 
calculation, or some other error condition, and the way you treat them 
should depend on the interpretation you are giving them.

What NANs cannot represent is any sort of valid statistical observation 
or data. Ask yourself: what sort of measurement or observation or survey 
question would give a NAN as a valid answer?

(Technically, one might use a NAN as a form of nominal data, but that 
would be an exceedingly contrived thing to do: "What is your favourite 
IEEE-754 feature?". There are much more natural ways to encode nominal 
data than to use actual NANs. Strings, for example.)



-- 
Steven
_______________________________________________
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/XMLLIEQF6J44IEPZFYV5LHZCZTEE7KVD/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to