Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:
I've been thinking about this a bit more. ISTM that for now, it's best to get mode() working for everyday use, returning just the first mode encountered. This keeps the signature simple (Iterable -> Scalar). In the future, if needed, there is room to add separate functions with their own clean signatures and use cases. For example, having a separate multimode() that always returns a list would be clearer and easier to use than setting a flag on the current scalar valued mode() function. Another example would be mode_estimate() that returns a scalar float that estimates the mode given data sampled from a continuous variable. This warrants its own function because the signature, use cases, options, and implementation method are all completely different from a mode based on counting. Categorical, binned, or ordinal data: mode(data: Iterable, *, first_tie=False) -> object multimode(data: Iterable) -> List[object] Continuous data: mode(data: Iterable[Real]) -> Real ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35892> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com