projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Small changes.
[python_utils.git]
/
math_utils.py
diff --git
a/math_utils.py
b/math_utils.py
index 156862a9c1b55eeec5515efef82f8f951d59b416..49ad407a58330144116c7d07976462a521f46d46 100644
(file)
--- 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]:
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
count: Dict[float, int] = collections.defaultdict(int)
for n in self.lowers:
count[-n] += 1