# Updating annotations

**URL:** <https://mne.discourse.group/t/updating-annotations/2489>\
**Category:** Support & Discussions\
**Tags:** eeg, evoked\
**Created:** [January 14, 2021, 3:28pm UTC](https://mne.discourse.group/t/updating-annotations/2489 "2021-01-14T15:28:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![robpetrosino](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/robpetrosino/32/51_2.png) [@robpetrosino](https://mne.discourse.group/u/robpetrosino)\
**Post date:** [January 14, 2021, 3:28pm UTC](https://mne.discourse.group/t/updating-annotations/2489/1 "2021-01-14T15:28:17Z")

</div>

Hello everyone,

I am trying to figure out a way to delete epochs that correspond to stimuli (in my case, words) whose behavioral response was below performance.

The simplest idea would be to use the `reject_by_annotation` argument of the `mne.Epoch` function, though I am having trouble figuring out how to do that, since the raw data is associated with annotations/events, which however do not contain any info regarding the words being presented. The word info are added as metadata only when epoching.

Can anyone suggest the best way to do this, given the issue above?

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [January 14, 2021, 3:40pm UTC](https://mne.discourse.group/t/updating-annotations/2489/2 "2021-01-14T15:40:12Z")

</div>

see [mne.Epochs — MNE 0.23.dev0 documentation](https://mne.tools/dev/generated/mne.Epochs.html#mne.Epochs.drop)

Alex

---

<div class="post-metadata">

**Author:** ![robpetrosino](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/robpetrosino/32/51_2.png) [@robpetrosino](https://mne.discourse.group/u/robpetrosino)\
**Post date:** [January 14, 2021, 4:20pm UTC](https://mne.discourse.group/t/updating-annotations/2489/3 "2021-01-14T16:20:38Z")

</div>

Thank you for your reply!

I see that the `drop()` method may be of use here. Just to clarify – the indices are just the consecutive index number of the epochs, right? So, I would just need to identify the indices of the epochs I want to delete and pass it through the function. Am I correct?

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [January 14, 2021, 4:38pm UTC](https://mne.discourse.group/t/updating-annotations/2489/4 "2021-01-14T16:38:44Z")

</div>

If the data are **not** preloaded, then the indices you pass to `drop()` are just the sequential numeric indices (so pass `[0, 5]` to drop the first and sixth trials).

If the data **are** preloaded, certain epochs may have already been dropped due to signal `reject` criteria provided when the `Epochs()` constructor was called. In that case, dropping the first and sixth trials might need different indices. For example, suppose the third and fourth epochs were rejected because of a big signal jump (maybe the subject scratched their nose), then the _remaining_ epochs will be 0, 1, 4, 5, 6, … so to drop the first and sixth trials, you need indices `[0, 3]`.

Either way, as long as the indices you pass to `drop()` refer to the epochs _based on their current order in the Epochs object_ — not based on the “original” order prior to epoch rejection — you should get the right result.

---

<div class="post-metadata">

**Author:** ![robpetrosino](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/robpetrosino/32/51_2.png) [@robpetrosino](https://mne.discourse.group/u/robpetrosino)\
**Post date:** [January 14, 2021, 4:39pm UTC](https://mne.discourse.group/t/updating-annotations/2489/5 "2021-01-14T16:39:29Z")

</div>

Ok, got it. Thank you both!
