def moving_average(ys, window=6):
    """
    Calculates moving average window of the given list of values.

    Args:
        ys (list[float]): list of values
        window (int): size of the window

    Returns:
        values (list[float]): list of values as moving average from `ys`. Same
          size as `ys`.
    """
    values = []
    result = []
    for y in ys:
        values.append(y)
        if len(values) > window:
            values = values[1:]
        result.append(sum(values) / len(values))
    return result