callcut.io.load_annotations🔗

callcut.io.load_annotations(fname)[source]🔗

Load call annotations from a CSV file.

The CSV file must contain columns start_seconds and stop_seconds. Despite the column names, values in the CSV are expected to be in milliseconds and are converted to seconds.

Parameters:
fnamestr | Path

Path to the CSV annotation file.

Returns:
intervalsarray of shape (n_intervals, 2)

Array of (start, stop) times in seconds. Each row represents one annotated call interval. Intervals are sorted by start time.

Examples

>>> intervals = load_annotations("recording_annotations.csv")
>>> intervals.shape
(42, 2)
>>> intervals[0]  # first interval in seconds
array([0.1234, 0.4562])