pyspark.sql.functions.min

pyspark.sql.functions.min(col: ColumnOrName) → pyspark.sql.column.Column[source]

Aggregate function: returns the minimum value of the expression in a group.

New in version 1.3.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

target column to compute on.

Returns
Column

column for computed results.

Examples

>>> df = spark.range(10)
>>> df.select(min(df.id)).show()
+-------+
|min(id)|
+-------+
|      0|
+-------+