Cropping Data Based on Annotations

I have uploaded EEG data that was primarily preprocessed using EEGLAB. The EEG recording was about one hour long and It has a handful of annotations that I would like to use to section out my data.

I’ve already been able to upload the .set data into mne through mne.io.read_raw_eeglab

How would I take this data and crop out data between “Annotation A” and “Annotation B”?

Thank you for your help!

You could filter your raw.annotations for the annotations you want, using the “description” property, and then by looking at the “onsets” and “durations”, you know the timings of where you want to crop.

The cropping itself could be done by raw.crop

Relevant links: