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

Polars · Function

pl.min

Creates an expression that computes the minimum value for one or more named columns. It is shorthand for col(names).min() and can be evaluated with operations such as select.

How it works

polars.min creates an expression that computes the minimum for each selected column during an aggregation. It is shorthand for applying min to col(names), and accepts either individual column names or a pattern that selects multiple columns.

Syntax

polars.min(*names: str) → Expr

Parameters

NameTypeDescription
namesstrName(s) of the columns to use in the aggregation.

Returns

Expr

Key points

  • polars.min constructs an expression for minimum-value aggregation.
  • It is equivalent in intent to applying .min() to a column expression.
  • The names parameter identifies the input columns.
  • With one column name, the selected result contains that column's minimum.
  • Multiple names produce separate minimum results for the selected columns.
  • Use DataFrame.select to evaluate the expression for named columns.

Common mistakes

  • This function is a convenience wrapper; the equivalent expression is pl.col(name).min().

Example: Minimum of multiple columns

import polars as pl

df = pl.DataFrame({"a": [1, 8, 3], "b": [4, 5, 2]})
result = df.select(pl.min("a", "b"))
print(result)

Selects the minimum independently for each named column.

When to use it

Find the minimum of one column

Column aggregation

Compute independent minima for several columns

Multi-column aggregation

Aggregate columns selected by a name pattern

Pattern-based selection

Interview questions

QWhat does polars.min return and how is it implemented conceptually?

pl.min returns a Polars expression representing a minimum aggregation. It can receive one or more column names and is syntactic sugar for pl.col(names).min().

Follow-up: How would you compute minima row by row instead of as an aggregation? Use pl.min_horizontal rather than pl.min.

QHow can you apply polars.min to multiple columns?

Pass a column name to select its minimum, or pass several names to produce one minimum result per selected column. The function can also use a column-selection pattern such as ^a|b$.

Follow-up: What does the pattern example select? It selects columns whose names match the supplied regular-expression pattern, such as a and b here.

QWhat are the parameter and return types?

The names argument identifies the columns used in the aggregation. The documented return type is Expr, so the expression is normally supplied to operations such as DataFrame.select.

Follow-up: What is the key distinction from min_horizontal? polars.min aggregates each selected column, whereas min_horizontal computes a row-wise minimum across columns.

  • polars.Expr.min
  • polars.min_horizontal
  • polars.col

Source: polars.min — Polars documentation. Checked 2026-10-15.