segment_annotations

ketos.data_handling.selection_table.segment_annotations(table, num, length, step=None, compute_overlap=False)[source]

Generate a segmented annotation table by stepping across the audio files, using a fixed step size (step) and fixed selection window size (length).

Args:
table: pandas DataFrame

Annotation table.

num: int

Number of segments

length: float

Selection length in seconds.

step: float

Selection step size in seconds. If None, the step size is set equal to the selection length.

compute_overlap: bool

If True, the fractional overlap between the selection window and the annotation will be computed and added as an extra column in the output table. Default is False.

Returns:
df: pandas DataFrame

Annotations table