group_by

API reference for group_by

group_by()

Group the events by a column. Use this method to form the grouped data for ranking models.

Parameters

Parameter
Type
Required
Default
Description

df

DataFrame

None

The dataframe with flat data

group_by_col

str

None

The column to group the data by

output_path

Path | str | None

None

Optional path to write the grouped data to. If not specified, data won’t be written anywhere

Returns

Dataframe in grouped format Return type: pd.DataFrame

Examples

COLUMN_NAME = ‘col_2’

grouped_df = group_by(df=df, group_by_col=COLUMN_NAME)

Last updated

Was this helpful?