def avg_and_total(iterable):
    items = 0
    total = 0.0

    for item in iterable:
        total += item
        items += 1

    return total / items, total

# Considerably lower than for the simple global script, since category
# data is much more sparse
Compute the average over a numeric iterable.
dataset/ETHPy150Open Yelp/dataset-examples/positive_category_words/weighted_category_positivity.py/avg_and_total