pyspark.sql.functions.
array_min
Collection function: returns the minimum value of the array.
New in version 2.4.0.
Changed in version 3.4.0: Supports Spark Connect.
Column
name of column or expression
minimum value of array.
Examples
>>> df = spark.createDataFrame([([2, 1, 3],), ([None, 10, -1],)], ['data']) >>> df.select(array_min(df.data).alias('min')).collect() [Row(min=1), Row(min=-1)]