vocalpy / crowsetta

A tool to work with any format for annotating animal sounds
https://crowsetta.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
52 stars 3 forks source link

ENH: Make SimpleSeq work with a csv that doesn't have labels for segments, just start and stop times #271

Closed NickleDave closed 1 month ago

NickleDave commented 1 month ago

Often people will save segmentation in a csv file, e.g. from a pandas.DataFrame.
This segmentation won't necessarily have labels with it -- they just applied some signal processing algorithm to segment.

We should make it easy to work with this segmentation, without having to modify the csv file.

One way to do this is to provide a default label for all segments.

We should add some arg to from_file like default_label that defaults to '-' or some other single character, that can be changed. The from_file function should check if there is a labels column in the csv file, and if not, it should add a column with the default label for every row.