def aggregate_avg(items, col):
    """
    Function to use on Group by Charts.
    accepts a list and returns the average of the list's items
    """
    try:
        return aggregate_sum(items, col) / aggregate_count(items, col)
    except Exception:
        log.warning(c.LOGMSG_WAR_DBI_AVG_ZERODIV)
        return 0.0

    Function to use on Group by Charts.
    accepts a list and returns the average of the list's items
    
flask_appbuilder/models/group.py