Some help removing bad segments with annotations!

Hey!

I’m attempting to remove some bad segments I annotated using mne.Annotations().
Unfortunately, my code removes the entire epoch rather than the annotation itself…

Is there a way around this?

I’m linking the github to my notebook below.

I’d value any assistance

I think your problem is that you are trying to epoch your data to the bad_segment annotation start times. mne.Epochs by default will drop any epochs that contain an annotation that starts with BAD_.

If you don’t have any other event markers but would like to epoch your data (excluding bad segments), I think what you are looking for is make_fixed_length_epochs