get_session_ends#
- get_session_ends(df: DataFrame, events_df: DataFrame, max_hours: float = 6) DataFrame[source]#
End of each session (subject, date) of df: the first time the same subject returned home (“Subject back home: …” or “The subject has returned home.”) after the session started, before its next session started and at most max_hours later. Columns: subject, date, end_date, session_duration (seconds). Sessions without such an event (e.g. events missing) are left out.
Matching the subject (instead of taking the next event of any subject) lets events of several boxes be used together.