# mne.Epochs reject epochs even when reject=None

**URL:** <https://mne.discourse.group/t/mne-epochs-reject-epochs-even-when-reject-none/4975>\
**Category:** Support & Discussions\
**Tags:** preprocessing, epochs\
**Created:** [June 1, 2022, 4:58am UTC](https://mne.discourse.group/t/mne-epochs-reject-epochs-even-when-reject-none/4975 "2022-06-01T04:58:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpelofi](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cpelofi/32/1528_2.png) [@cpelofi](https://mne.discourse.group/u/cpelofi)\
**Post date:** [June 1, 2022, 4:58am UTC](https://mne.discourse.group/t/mne-epochs-reject-epochs-even-when-reject-none/4975/1 "2022-06-01T04:58:27Z")

</div>

Hi there,

I am working with:

- MNE version: e.g. 0.24.1
- operating system: macOS Monterey (version 12.3.1) Apple M1

I am trying to epoch data from audiovisual stimuli that are long (60 seconds). I have only a few trials.

When using mne.Epochs I specify that I don’t want to reject any epochs but it still does it anyway, although it initially detects all the events it is supposed to. Very puzzling…

```python
epoch = mne.Epochs(raw, events, event_id=event_id, tmin=-0.2, tmax=60,
                   proj=False, baseline=None, preload=True, reject=None,
                   flat=None)

```

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![cbrnr](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cbrnr/32/1409_2.png) [@cbrnr](https://mne.discourse.group/u/cbrnr)\
**Post date:** [June 1, 2022, 7:00am UTC](https://mne.discourse.group/t/mne-epochs-reject-epochs-even-when-reject-none/4975/2 "2022-06-01T07:00:53Z")

</div>

Do you have any annotations starting with “BAD”? There is another parameter `reject_by_annotation=True`, which rejects all segments containing any such annotations.

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [June 1, 2022, 7:13am UTC](https://mne.discourse.group/t/mne-epochs-reject-epochs-even-when-reject-none/4975/3 "2022-06-01T07:13:03Z")

</div>

Hello @cpelofi and welcome to the forum!

You can use

```python
epochs.plot_drop_log(ignore=[])

```

to get a visualization of how many epochs were dropped and for what reason.

---

<div class="post-metadata">

**Author:** ![cpelofi](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cpelofi/32/1528_2.png) [@cpelofi](https://mne.discourse.group/u/cpelofi)\
**Post date:** [June 1, 2022, 11:31am UTC](https://mne.discourse.group/t/mne-epochs-reject-epochs-even-when-reject-none/4975/4 "2022-06-01T11:31:43Z")

</div>

I looked into it and I have no annotations in my data.  
Thanks!

---

<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:** [June 1, 2022, 2:52pm UTC](https://mne.discourse.group/t/mne-epochs-reject-epochs-even-when-reject-none/4975/5 "2022-06-01T14:52:50Z")

</div>

What is the result of the command @richard suggested (`plot_drop_log`)? We could try to keep guessing why it’s happening, but looking at the x axis labels in the plot will be easier 🙂 Once we know the reason, we can help you avoid it.

---

<div class="post-metadata">

**Author:** ![cpelofi](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cpelofi/32/1528_2.png) [@cpelofi](https://mne.discourse.group/u/cpelofi)\
**Post date:** [June 1, 2022, 4:11pm UTC](https://mne.discourse.group/t/mne-epochs-reject-epochs-even-when-reject-none/4975/6 "2022-06-01T16:11:32Z")

</div>

I think the problem comes from the fact that I resample (from 1000 to 100 Hz) earlier in the pipeline and the the events samples are not accordingly changed. Therefore the tmax that I define for my epochs ends up being too long.  
If I don’t resample it rejects only the last one for the same reason (I should have kept the data running a little longer before stopping the recording)

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [June 1, 2022, 4:15pm UTC](https://mne.discourse.group/t/mne-epochs-reject-epochs-even-when-reject-none/4975/7 "2022-06-01T16:15:20Z")

</div>

Please see the Warning box here, it explains exactly what you need to do:

[https://mne.tools/stable/generated/mne.io.Raw.html#mne.io.Raw.resample](https://mne.tools/stable/generated/mne.io.Raw.html#mne.io.Raw.resample)
