X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=histogram.py;h=f85abea2c45f05ef65c70657bd1b2b6f53f04c04;hb=e8fbbb7306430478dec55d2c963eed116d8330cc;hp=c673e161a6318fabeb155e1cdb2a2591abe730e0;hpb=0d63d44ac89aab38fe95f36497adaf95110ab949;p=python_utils.git diff --git a/histogram.py b/histogram.py index c673e16..f85abea 100644 --- a/histogram.py +++ b/histogram.py @@ -1,8 +1,9 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +"""A text-based simple histogram helper class.""" + import math -from numbers import Number from typing import Dict, Generic, Iterable, List, Optional, Tuple, TypeVar T = TypeVar("T", int, float) @@ -11,6 +12,8 @@ Count = int class SimpleHistogram(Generic[T]): + """A simple histogram.""" + # Useful in defining wide open bottom/top bucket bounds: POSITIVE_INFINITY = math.inf NEGATIVE_INFINITY = -math.inf