Message337620
The problem remains that the function can return a number or a list for input that is a list of numbers. This means the user will need to handle both possibilities every time, which is a heavy burden for such a simple function.
SciPy's mode function does return the minimum mode when there is a tie, which as far as I can tell is an arbitrary choice. But in that context, since the input is almost always numerical, a minimum is at least well defined, which is not true for an input with a mix of types.
For the general use case, the current behavior - raising an exception - in case of tie conveys the most information. |
|
Date |
User |
Action |
Args |
2019-03-10 16:42:03 | scotchka | set | recipients:
+ scotchka, terry.reedy, steven.daprano, wolma, sria91 |
2019-03-10 16:42:03 | scotchka | set | messageid: <1552236123.55.0.0109643281436.issue28956@roundup.psfhosted.org> |
2019-03-10 16:42:03 | scotchka | link | issue28956 messages |
2019-03-10 16:42:03 | scotchka | create | |
|