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

SArray. cumulative_mean()

Return the cumulative mean of the elements in the SArray.

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

Returns: out : Sarray[float, array.array]

Notes

Examples

sa = SArray([1, 2, 3, 4, 5]) sa.cumulative_mean() dtype: float rows: 3 [1, 1.5, 2, 2.5, 3]