Split Sessions

Split each path into sub-sessions and add session ID and index columns.

At least one boundary criterion must be provided: separator, start_event + end_event, or timeout. separator and start_event/end_event are mutually exclusive; timeout may be combined with either.

Usage

stream.split_sessions(timeout="30m")
stream.split_sessions(separator="app_open")
stream.split_sessions(start_event="session_start", end_event="session_end")
stream.split_sessions(separator="app_open", timeout="1h")

Parameters

ParameterTypeDescription
session_id_colstr, default "session_id"``Name of the new column that holds the unique session identifier.
session_index_colstr, default "session_index"``Name of the new column that holds the 0-based session index within each path.
separatorstr or list of str, optionalEvent name(s) that mark a session boundary. The separator event starts a new session; the separator row itself belongs to the new session.
start_eventstr or list of str, optionalEvent name(s) that mark the start of a session. Must be provided together with end_event.
end_eventstr or list of str, optionalEvent name(s) that mark the end of a session. Must be provided together with start_event.
timeoutstr or pandas.Timedelta, optionalInactivity gap after which a new session starts, as a pandas-style duration string with an explicit unit — e.g. "30m", "1h", "1800s" — or a pandas.Timedelta. Bare numbers are rejected to avoid unit ambiguity.
path_colstr, optionalPath ID column override; defaults to schema.path_col.
event_colstr, optionalEvent column override; defaults to schema.event_col.