pyspark.pandas.window.Expanding.max

Expanding.max() → FrameLike

Calculate the expanding maximum.

Note

the current implementation of this API uses Spark’s Window without specifying partition specification. This leads to move all data into single partition in single machine and could cause serious performance degradation. Avoid this method against very large dataset.

Returns
Series or DataFrame

Return type is determined by the caller.

See also

Series.expanding

Calling object with Series data.

DataFrame.expanding

Calling object with DataFrames.

Series.max

Similar method for Series.

DataFrame.max

Similar method for DataFrame.

Examples

Performing a expanding minimum with a window size of 3.

>>> s = ps.Series([4, 3, 5, 2, 6])
>>> s.expanding(3).max()
0    NaN
1    NaN
2    5.0
3    5.0
4    6.0
dtype: float64