def _avg(count, avg, new_num):
    """Incremental average.

    :param count: int -- The previous total.
    :param avg: float -- The previous average.
    :param new_num: int|float -- The new number.
    :return: float -- The new average.
    """
    if not count:
        return float(new_num)
    return (count * avg + new_num) / (count + 1.0)