Message335726
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 |
|
Date |
User |
Action |
Args |
2019-02-16 22:52:05 | rhettinger | set | recipients:
+ rhettinger, steven.daprano, francismb, Windson Yang |
2019-02-16 22:52:05 | rhettinger | set | messageid: <1550357525.69.0.0324711953548.issue35892@roundup.psfhosted.org> |
2019-02-16 22:52:05 | rhettinger | link | issue35892 messages |
2019-02-16 22:52:05 | rhettinger | create | |
|