summaryrefslogtreecommitdiff
path: root/histogram.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2021-09-07 22:20:40 -0700
committerScott Gasch <[email protected]>2021-09-07 22:20:40 -0700
commitb10d30a46e601c9ee1f843241f2d69a1f90f7a94 (patch)
tree30c95e6f4333b57ff3ae7a4dee278b2097612d10 /histogram.py
parentf49bb9db0c6d1a8622dca1717db68462a4209112 (diff)
Various changes.
Diffstat (limited to 'histogram.py')
-rw-r--r--histogram.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/histogram.py b/histogram.py
index 0368376..3391b0b 100644
--- a/histogram.py
+++ b/histogram.py
@@ -69,13 +69,15 @@ class SimpleHistogram(Generic[T]):
def __repr__(self,
label_formatter='%10s') -> str:
from text_utils import bar_graph
+
max_population: Optional[int] = None
for bucket in self.buckets:
pop = self.buckets[bucket]
if pop > 0:
- last_bucket_start = bucket[0]
+ last_bucket_start = bucket[0] # beginning of range
if max_population is None or pop > max_population:
- max_population = pop
+ max_population = pop # bucket with max items
+
txt = ""
if max_population is None:
return txt