get_followers_matrix#
- get_followers_matrix(occupancy_df: DataFrame, max_gap_minutes: float = None) DataFrame[source]#
Who follows whom in the box: how many times each subject (columns) started a session right after a session of another subject (rows). The same subject twice in a row is not counted.
- Parameters:
occupancy_df – sessions, from get_start_and_end_of_sessions_df.
max_gap_minutes – if given, a session only follows another one if it started at most this many minutes after the other ended.
- Returns:
A square DataFrame, subjects in rows (before) and columns (after).