def accumulate(iterable):
    """ Accumulate the values of an iterable to a new array. """
    accumulator = 0
    array = []
    for x in iterable:
        accumulator += x
        array.append(accumulator)
    return array
