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
| Parameter | Type | Description |
|---|---|---|
session_id_col | str, default "session_id"`` | Name of the new column that holds the unique session identifier. |
session_index_col | str, default "session_index"`` | Name of the new column that holds the 0-based session index within each path. |
separator | str or list of str, optional | Event name(s) that mark a session boundary. The separator event starts a new session; the separator row itself belongs to the new session. |
start_event | str or list of str, optional | Event name(s) that mark the start of a session. Must be provided together with end_event. |
end_event | str or list of str, optional | Event name(s) that mark the end of a session. Must be provided together with start_event. |
timeout | str or pandas.Timedelta, optional | Inactivity 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_col | str, optional | Path ID column override; defaults to schema.path_col. |
event_col | str, optional | Event column override; defaults to schema.event_col. |