pyspark.pandas.groupby.GroupBy.min

GroupBy.min(numeric_only: Optional[bool] = False) → FrameLike

Compute min of group values.

Parameters
numeric_onlybool, default False

Include only float, int, boolean columns. If None, will attempt to use everything, then use only numeric data.

Examples

>>> df = ps.DataFrame({"A": [1, 2, 1, 2], "B": [True, False, False, True],
...                    "C": [3, 4, 3, 4], "D": ["a", "b", "b", "a"]})
>>> df.groupby("A").min().sort_index()
       B  C  D
A
1  False  3  a
2  False  4  a

Include only float, int, boolean columns when set numeric_only True.

>>> df.groupby("A").min(numeric_only=True).sort_index()
       B  C
A
1  False  3
2  False  4