# Some help removing bad segments with annotations!

**URL:** <https://mne.discourse.group/t/some-help-removing-bad-segments-with-annotations/8003>\
**Category:** Support & Discussions\
**Tags:** preprocessing, eeg\
**Created:** [December 14, 2023, 2:31am UTC](https://mne.discourse.group/t/some-help-removing-bad-segments-with-annotations/8003 "2023-12-14T02:31:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vxnuaj](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/vxnuaj/32/3267_2.png) [@vxnuaj](https://mne.discourse.group/u/vxnuaj)\
**Post date:** [December 14, 2023, 2:31am UTC](https://mne.discourse.group/t/some-help-removing-bad-segments-with-annotations/8003/1 "2023-12-14T02:31:31Z")

</div>

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.

> <https://github.com/vxnuaj/mneprocess/blob/main/MNE-EEG-PROCESSING/Replicate2.ipynb>

I’d value any assistance

---

<div class="post-metadata">

**Author:** ![scott-huberty](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/scott-huberty/32/2715_2.png) [@scott-huberty](https://mne.discourse.group/u/scott-huberty)\
**Post date:** [December 16, 2023, 3:58pm UTC](https://mne.discourse.group/t/some-help-removing-bad-segments-with-annotations/8003/2 "2023-12-16T15:58:09Z")

</div>

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](https://mne.tools/dev/generated/mne.make_fixed_length_epochs.html)
