summaryrefslogtreecommitdiff
path: root/math_utils.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2022-03-05 10:15:03 -0800
committerScott Gasch <[email protected]>2022-03-05 10:15:03 -0800
commitd2e437a04124fa3c6e3175205f943769ba443393 (patch)
treed38a6201ab72f5ae0b80307d10cf406e15f8d79d /math_utils.py
parent0dc52d000262da329728e01444242e35809e107e (diff)
Improve text wrapping; add indent option.
Diffstat (limited to 'math_utils.py')
-rw-r--r--math_utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/math_utils.py b/math_utils.py
index 156862a..49ad407 100644
--- a/math_utils.py
+++ b/math_utils.py
@@ -74,6 +74,8 @@ class NumericPopulation(object):
return self.aggregate / count
def get_mode(self) -> Tuple[float, int]:
+ """Returns the mode (most common member)."""
+
count: Dict[float, int] = collections.defaultdict(int)
for n in self.lowers:
count[-n] += 1