def float_list_to_int_dict(lst, bucket_size):
    """Takes a list of floats and a bucket size and return a dict of
    { n : count, ...} where the count is the number of floats that drop into
    the range n * bucket_size to (n + 1) * bucket_size."""
    ret = {}
    for val in lst:
        k = int(round(val / bucket_size, 0))
        try:
            ret[k] += 1
        except __HOLE__:
            ret[k] = 1
    return ret
dataset/ETHPy150Open manahl/PythonTrainingExercises/Intermediate/Histogram/solution/DictHistogram.py/float_list_to_int_dict