summaryrefslogtreecommitdiff
path: root/math_utils.py
diff options
context:
space:
mode:
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