cudf.core.groupby.SeriesGroupBy.transform#
- SeriesGroupBy.transform(func, *args, engine=None, engine_kwargs=None, **kwargs)[source]#
Apply an aggregation, then broadcast the result to the group size.
- Parameters:
- func: str or callable
Aggregation to apply to each group. Note that the set of operations currently supported by transform is identical to that supported by the agg method.
- Returns:
- A Series or DataFrame of the same size as the input, with the
- result of the aggregation per group broadcasted to the group
- size.
See also
Examples
import cudf df = DataFrame({'a': [2, 1, 1, 2, 2], 'b': [1, 2, 3, 4, 5]}) df.groupby('a').transform('max') b 0 5 1 3 2 3 3 5 4 5