pandas.api.typing.DataFrameGroupBy.transform

pandas 3.1.1 · GroupBy · method

Calculate group-level values and return a result aligned to the original DataFrame rows.

Call syntax

pd.api.typing.DataFrameGroupBy.transform(
    func=None,
    *args,
    engine=None,
    engine_kwargs=None,
    **kwargs,
)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
func Optional
Positional or keyword
Default None
function, str, list, or dict

Supply a supported operation name or a callable, depending on this API.

*args Optional
Additional positional arguments
engine Optional
Keyword only
Default None
str

Choose the implementation that performs the operation.

engine_kwargs Optional
Keyword only
Default None
dict

Pass a dictionary of options to the selected engine.

**kwargs Optional
Additional keyword arguments

Returns

DataFrame