Happy New Year (off topic).

Based on a quick review of the python docs, the bug report, PEP 450
and this thread, I suggest

1. More carefully draw attention to the NaN feature, in the
documentation for existing Python versions.
2. Consider revising statistics.py so that it raises an exception,
when passed NaN data.

https://www.python.org/dev/peps/pep-0450/#rationale says
<quote>
The proposed statistics module is motivated by the "batteries
included" philosophy towards the Python standard library. Raymond
Hettinger and other senior developers have requested a quality
statistics library that falls somewhere in between high-end statistics
libraries and ad hoc code. Statistical functions such as mean,
standard deviation and others are obvious and useful batteries,
familiar to any Secondary School student.
</quote>

The PEP makes no mention of NaN. Was it in error, in not stating that
NaN data is admissable? Is NaN part of the "batteries familar to any
Secondary School student?".

https://docs.python.org/3/library/statistics.html says
<quote>
This module provides functions for calculating mathematical statistics
of numeric (Real-valued) data.
</quote>

Some people regard NaN as not being a real-valued number. (Hint:
There's a clue in the name: Not A Number.)

Note that statistics.py already raises StatisticsError, when it
regards the data as flawed.

Finally, I suggest that we might learn from
==
Fix some special cases in Fractions?
https://mail.python.org/pipermail/python-ideas/2018-August/053083.html
==

I'll put a brief summary of my message into the bug tracker for this issue.

-- 
Jonathan
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to