SciPy, axis=None, dtype=None, out=None) = < object>

Return the cumulative sum of the array elements over the given axis.

Masked values are set to 0 internally during the computation. However, their position is saved, and the result will be masked at the same locations.

Refer to numpy.cumsum for full documentation.

See also

corresponding function for ndarrays
equivalent function


The mask is lost if out is not a valid MaskedArray !

Arithmetic is modular when using integer types, and no error is raised on overflow.


>>> marr =, mask=[0,0,0,1,1,1,0,0,0,0])
>>> print(marr.cumsum())
[0 1 3 -- -- -- 9 16 24 33]

Previous topic

Next topic