def counter_mean(counter):
    """Takes the mean of a collections.Counter object (or dictionary)."""
    mean = 0.
    total = 0.
    for k, v in counter.items():
        if k <= 0:
            k = 200
        mean += k * v
        total += v
    return mean / total