pyspark.pandas.window.Expanding.min#
- Expanding.min()[source]#
Calculate the expanding minimum.
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
Returned object type is determined by the caller of the expanding calculation.
See also
pyspark.pandas.Series.expandingCalling object with a Series.
pyspark.pandas.DataFrame.expandingCalling object with a DataFrame.
pyspark.pandas.Series.minSimilar method for Series.
pyspark.pandas.DataFrame.minSimilar 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).min() 0 NaN 1 NaN 2 3.0 3 2.0 4 2.0 dtype: float64