def average(keyword, values):
    """
    calculate average of all values at values[+].keyword and return
    :param keyword: the key of the value you care about
    :param values: [{key: value},...] array of dicts, values assumed numeric
    :return: single averaged value
    """
    average = 0.0
    for val in values:
        average += float(val[keyword])

    if len(values) > 0:
        average = average / len(values)

    return average