bouts

aggregate_bouts(observations, *, max_bout_gap, index_columns)

Aggregate observations (behavioral intervals) into bouts.

Parameters:
  • observations (DataFrame) – The observations to aggregate.

  • max_bout_gap (float) – The maximum gap between observations to consider them part of the same bout.

  • index_columns (tuple[str, ...]) – The columns to use as the index, unique combinations should point to independent observations (e.g., of one individual).

Return type:

DataFrame

Returns:

The aggregated bouts.