# Manually dropping bad epochs

**URL:** <https://mne.discourse.group/t/manually-dropping-bad-epochs/9069>\
**Category:** Support & Discussions\
**Created:** [July 13, 2024, 1:27pm UTC](https://mne.discourse.group/t/manually-dropping-bad-epochs/9069 "2024-07-13T13:27:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugues1273](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/hugues1273/32/2423_2.png) [@Hugues1273](https://mne.discourse.group/u/Hugues1273)\
**Post date:** [July 13, 2024, 1:27pm UTC](https://mne.discourse.group/t/manually-dropping-bad-epochs/9069/1 "2024-07-13T13:27:57Z")

</div>

Dear all,

I would like to drop bad epochs from my epochs data. Therefore, I create Epochs:

`Epochs = mne.Epochs(RawData_Notched, events = Events_from_annot, tmin = Tmin, tmax = Tmax, baseline = None, preload = True, event_id = {"Stimulus/S 5": 5, "Stimulus/S 10": 10, "Stimulus/S 14": 14})`

Then I plot the epochs and I left click on the epochs I want to remove:  
`Epochs.plot()`

Then I remove the visually selected epochs:  
`Epochs.drop(True, reason = "bads")`

Then I plot again the Epochs and selected Epochs indeed seems to have been removed  
`Epochs.plot()`

However, when I want to get the indices of the removed Epochs, bads is empty:  
`Epochs.info`

returns

```python

<Info | 9 non-empty values
 bads: []
 ch_names: Fp1, F3, F7, FT9, FC5, FC1, C3, T7, TP9, CP5, CP1, Pz, P3, P7, ...
 chs: 64 EEG, 1 ECG
 custom_ref_applied: True
 dig: 67 items (3 Cardinal, 64 EEG)
 highpass: 0.5 Hz
 lowpass: 100.0 Hz
 meas_date: 2024-03-09 10:54:44 UTC
 nchan: 65
 projs: []
 sfreq: 500.0 Hz
>Dropped 0 epochs: 
The following epochs were marked as bad and are dropped:
[]
Channels marked as bad:
none

```

What is wrong? I would like to get the indices of the visually removed Epochs in the bad list to save them because it is important to stay transparent at each step, but I can’t, the bad list is empty…

I am using Spyder 5.5.1 and python 3.12, and I am using Windows.

Thank you so much for your help!!

---

<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:** [July 13, 2024, 2:41pm UTC](https://mne.discourse.group/t/manually-dropping-bad-epochs/9069/2 "2024-07-13T14:41:28Z")

</div>

Hello, when you click on epochs to mark them as bad and then close the plot, the selected epochs are automatically removed.

---

<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:** [July 14, 2024, 8:14am UTC](https://mne.discourse.group/t/manually-dropping-bad-epochs/9069/3 "2024-07-14T08:14:12Z")

</div>

I think they should be available in `epochs.drop_log` (BTW, I recommend to name your epochs object `epochs` instead of `Epochs`).

---

<div class="post-metadata">

**Author:** ![Hugues1273](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/hugues1273/32/2423_2.png) [@Hugues1273](https://mne.discourse.group/u/Hugues1273)\
**Post date:** [July 14, 2024, 1:43pm UTC](https://mne.discourse.group/t/manually-dropping-bad-epochs/9069/4 "2024-07-14T13:43:42Z")

</div>

Ok!! Thank you very much! I did not know! I will try! Otherwise I will write manually the epochs I remove.  
Thank you so much for your time and your help!

Best,

Hugues

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 21, 2024, 1:44pm UTC](https://mne.discourse.group/t/manually-dropping-bad-epochs/9069/5 "2024-07-21T13:44:20Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
