pandas.SparseArray.cumsum

SparseArray.cumsum(axis=0, *args, **kwargs)[source]

Cumulative sum of non-NA/null values.

When performing the cumulative summation, any non-NA/null values will be skipped. The resulting SparseArray will preserve the locations of NaN values, but the fill value will be np.nan regardless.

Parameters:
axis : int or None

Axis over which to perform the cumulative summation. If None, perform cumulative summation over flattened array.

Returns:
cumsum : SparseArray
Scroll To Top