See https://bugs.python.org/issue35892

The issue here is that statistics.mode, as initially designed, raises an 
exception for the case of multiple equal most-frequent data points. This 
is true to the way mode is taught in schools, but it may not be the most 
useful behaviour.

Raymond has suggested:

- keep the status quo;

- change mode() to return "the first tie" instead of raising an 
  exception (with or without a deprecation warning for one release);

- add a flag to specify the behaviour.


I'm especially interested in opinions from those who use the 
function. What would be useful for you? How do you use it?
interactively or in scripts?

(When I designed this, I mostly imagined that mode() would be used 
interactively, using the interpreter as a calculator.)

Would changing the behaviour break your code?

Note that this question is seperate from that of whether or not there 
should be a multimode function.


-- 
Steven
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to