pandas.Series.cummin#
- Series.cummin(axis=0, skipna=True, *args, **kwargs)[source]#
Return cumulative minimum over a Series.
Returns a Series of the same size containing the cumulative minimum.
- Parameters:
- axis{0 or ‘index’}, default 0
This parameter is unused and defaults to 0.
- skipnabool, default True
If the entire series is NA, the result will be NA.
- *args, **kwargs
Additional keywords have no effect but might be accepted for compatibility with NumPy.
- Returns:
- Series
Return cumulative minimum of the Series.
See also
core.window.expanding.Expanding.minSimilar functionality but ignores
NaNvalues.Series.minReturn the minimum value of the Series.
Series.cummaxReturn cumulative maximum.
Series.cumsumReturn cumulative sum.
Series.cumprodReturn cumulative product.
Examples
>>> s = pd.Series([2, np.nan, 5, -1, 0]) >>> s 0 2.0 1 NaN 2 5.0 3 -1.0 4 0.0 dtype: float64
By default, NA values are ignored.
>>> s.cummin() 0 2.0 1 NaN 2 2.0 3 -1.0 4 -1.0 dtype: float64
To include NA values in the operation, use
skipna=False>>> s.cummin(skipna=False) 0 2.0 1 NaN 2 NaN 3 NaN 4 NaN dtype: float64