pyspark.pandas.DataFrame.max¶
-
DataFrame.
max
(axis: Union[int, str, None] = None, skipna: bool = True, numeric_only: bool = None) → Union[int, float, bool, str, bytes, decimal.Decimal, datetime.date, datetime.datetime, None, Series]¶ Return the maximum of the values.
- Parameters
- axis{index (0), columns (1)}
Axis for the function to be applied on.
- skipnabool, default True
Exclude NA/null values when computing the result.
Supported including NA/null values.
- numeric_onlybool, default None
If True, include only float, int, boolean columns. This parameter is mainly for pandas compatibility. False is supported; however, the columns should be all numeric or all non-numeric.
- Returns
- maxscalar for a Series, and a Series for a DataFrame.
Examples
>>> df = ps.DataFrame({'a': [1, 2, 3, np.nan], 'b': [0.1, 0.2, 0.3, np.nan]}, ... columns=['a', 'b'])
On a DataFrame:
>>> df.max() a 3.0 b 0.3 dtype: float64
>>> df.max(axis=1) 0 1.0 1 2.0 2 3.0 3 NaN dtype: float64
On a Series:
>>> df['a'].max() 3.0