Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Pandas · Module

df.cummin

Returns the cumulative minimum along a DataFrame axis, preserving the input shape. By default it operates down columns, skips missing values, and can optionally restrict processing to numeric and Boolean columns.

How it works

DataFrame.cummin() returns a same-shaped object whose values are the running minimum along the selected axis. With the default index axis, each column is evaluated independently; axis=1 instead evaluates values across each row. Missing values are skipped by default, while numeric_only can restrict processing to numeric and Boolean columns.

Syntax

DataFrame.cummin(axis=0, skipna=True, numeric_only=False, **kwargs)

Parameters

NameTypeDescription
axis{0 or 'index', 1 or 'columns'}, default 0The index or the name of the axis; 0, None, or 'index' selects the index axis, while 1 or 'columns' selects the columns axis. Default: 0.
skipnabool, default TrueWhether to exclude missing values. Default: True.
numeric_onlybool, default FalseWhether to include only float, integer, and Boolean columns. Default: False.
**args, **kwargsvariadicAdditional compatibility arguments accepted by the underlying implementation.

Returns

DataFrame or Series: cumulative minimum of the input DataFrame or Series.

Key points

  • The method calculates a running minimum along one selected DataFrame axis.
  • The result preserves the input object's shape rather than reducing it to one aggregate value.
  • Axis 0, None, and the index label select the default down-column direction.
  • Setting axis=1 changes the operation to a left-to-right running minimum within each row.

Common mistakes

  • Skipping missing values does not turn an entirely missing row or column into a numeric result; it remains missing.
  • With numeric_only=True, non-numeric columns are excluded from the calculation.

Example: Cumulative minima along both axes

import pandas as pd

df = pd.DataFrame({"A": [2, 3, 1], "B": [1, None, 0]})
print(df.cummin())
print(df.cummin(axis=1))

Computes running minima down columns by default, then across each row when axis=1.

When to use it

Running historical lows

Track the lowest observed value to date separately for each column in ordered records.

Row-wise minima

Find progressively smaller values across fields within each record.

Numeric-column filtering

Avoid applying the operation to text or other nonnumeric fields in mixed-type data.

Interview questions

QWhat does DataFrame.cummin() return, and what is its default direction?

It computes the cumulative minimum along a DataFrame axis and returns a DataFrame of the same size. The default axis is 0, so each column receives its running minimum independently.

Follow-up: What changes with axis=1? Each row is processed from left to right, producing the running minimum across that row instead of down columns.

QHow does skipna affect cumulative minima?

skipna=True is the default, so missing values are excluded when possible. However, an entirely missing row or column still produces missing output.

Follow-up: What is a practical consequence? A later non-missing value can resume the cumulative calculation after a missing value when skipna remains enabled.

QWhat does numeric_only control?

numeric_only=True limits the operation to float, integer, and Boolean columns. The default is False, so the operation is not restricted to those column types.

Follow-up: When would you use it? Use numeric_only when a mixed-type DataFrame should be processed only through its numeric and Boolean columns.

  • DataFrame.cummax
  • DataFrame.cumprod
  • DataFrame.cumsum
  • Series.cummin

Source: pandas.DataFrame.cummin. Checked 2026-10-15.