From d2e437a04124fa3c6e3175205f943769ba443393 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Sat, 5 Mar 2022 10:15:03 -0800 Subject: Improve text wrapping; add indent option. --- math_utils.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'math_utils.py') 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 -- cgit v1.3