def rolling_average(values, window):
    if window <= 0:
        raise ValueError("window must be positive")
    
    averages = []
    for i in range(len(values) - window + 1):
        window_slice = values[i : i + window]
        averages.append(sum(window_slice) / window)
    return averages
