turicreate.SArray.cumulative_max — Turi Create API 6.4.1 documentation (original) (raw)

SArray. cumulative_max()

Return the cumulative maximum value of the elements in the SArray.

Returns an SArray where each element in the output corresponds to the maximum value of all the elements preceding and including it. The SArray is expected to be of numeric type (int, float).

Returns: out : SArray[int, float]

Notes

Examples

sa = SArray([1, 0, 3, 4, 2]) sa.cumulative_max() dtype: int rows: 3 [1, 1, 3, 4, 4]