pyspark.pandas.Series.agg¶
-
Series.
agg
(func: Union[str, List[str]]) → Union[int, float, bool, str, bytes, decimal.Decimal, datetime.date, datetime.datetime, None, pyspark.pandas.series.Series]¶ Aggregate using one or more operations over the specified axis.
- Parameters
- funcstr or a list of str
function name(s) as string apply to series.
- Returns
- scalar, Series
The return can be: - scalar : when Series.agg is called with single function - Series : when Series.agg is called with several functions
See also
Series.apply
Invoke function on a Series.
Series.transform
Only perform transforming type operations.
Series.groupby
Perform operations over groups.
DataFrame.aggregate
The equivalent function for DataFrame.
Notes
agg is an alias for aggregate. Use the alias.
Examples
>>> s = ps.Series([1, 2, 3, 4]) >>> s.agg('min') 1
>>> s.agg(['min', 'max']).sort_index() max 4 min 1 dtype: int64