MaskedArray.cumsum()

numpy.ma.MaskedArray.cumsum

MaskedArray.cumsum(axis=None, dtype=None, out=None) [source]

Return the cumulative sum of the elements along the given axis. The cumulative sum is calculated over the flattened array by default, otherwise over the specified 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.

Parameters:

axis : {None, -1, int}, op