Steven D'Aprano <[email protected]> added the comment:
> Proposed spec:
> '''
> Modify the API statistics.mode to handle multimodal cases so that the
> first mode encountered is the one returned. If the input is empty,
> raise a StatisticsError.
Are you happy guaranteeing that it will always be the first mode
encountered? I'm not happy about it, but I'll follow you lead on this
one.
> TestCases:
> mode([]) --> StatisticsError
> mode('aabbbcc') --> 'c'
That should be 'b'.
> mode(iter('aabbbcc')) --> 'c'
And again 'b'.
> mode('eeffddddggaaaa') --> 'a'
If it is first encountered, that should be 'd'.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35892>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com