pyspark.RDD.min

RDD.min(key: Optional[Callable[[T], S]] = None) → T[source]

Find the minimum item in this RDD.

New in version 1.0.0.

Parameters
keyfunction, optional

A function used to generate key for comparing

Returns
T

the minimum item

See also

RDD.max()

Examples

>>> rdd = sc.parallelize([2.0, 5.0, 43.0, 10.0])
>>> rdd.min()
2.0
>>> rdd.min(key=str)
10.0