[Numpy-discussion] Want cumsum-like function

Robert Kern robert.kern@gmail....
Wed Feb 24 23:00:40 CST 2010


On Wed, Feb 24, 2010 at 22:53, Peter Shinners <pete@shinners.org> wrote:
> I want a function that works like cumsum, but starts at zero, instead of
> starting with the first actual value.
>
> For example; I have an array with [4,3,3,1].
> Cumsum will give me an array with [4,7,10,11].
> I want an array that is like [0,4,7,8].

I don't understand what process would give you [0, 4, 7, 8] rather
than [0, 4, 7, 10]. Can you explain a bit more?

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the NumPy-Discussion mailing list