GroupEvents#

Data processor#

class retentioneering.data_processors_lib.group_events.GroupEvents(params)[source]#

Filter the specified events from the input eventstream and create new synthetic events, with names based on the old events’ names.

Parameters:
event_namestr

Name of the created event.

funcCallable[[DataFrame, Optional[EventstreamSchema]], Any]

Custom function that returns boolean mask with the same length as input eventstream.

  • If True - events will be grouped.

  • If False - events will be remained.

event_typestr, default “group_alias”

Event_type name for the grouped events. If custom event_type is created, it should be added to the DEFAULT_INDEX_ORDER.

Returns:
Eventstream

Eventstream with:

  • new synthetic events with group_alias or custom type`

event_name

event_type

timestamp

raw_event_name

raw

raw_event

new_event_name

group_alias

raw_event

Notes

See Data processors user guide for the details.

class retentioneering.data_processors_lib.group_events.GroupEventsParams(*, event_name, func, event_type='group_alias')[source]#

A class with parameters for GroupEvents class.

Eventstream#

GroupEventsHelperMixin.group_events(event_name, func, event_type='group_alias')[source]#

A method of Eventstream class that filters and replaces raw events with new synthetic events, having the same timestamp and user_id, but new event_name.

Parameters:
event_namestr

Name of the created event.

funcCallable[[DataFrame, Optional[EventstreamSchema]], Any]

Custom function that returns boolean mask with the same length as input eventstream.

  • If True - events will be grouped.

  • If False - events will be remained.

event_typestr, default “group_alias”

Event_type name for the grouped events. If custom event_type is created, it should be added to the DEFAULT_INDEX_ORDER.

Returns:
Eventstream

Input eventstream with replaced events.