# Could not find any of the events you specified.

**URL:** <https://mne.discourse.group/t/could-not-find-any-of-the-events-you-specified/6023>\
**Category:** Support & Discussions\
**Tags:** preprocessing, eeg, epochs\
**Created:** [December 1, 2022, 5:47pm UTC](https://mne.discourse.group/t/could-not-find-any-of-the-events-you-specified/6023 "2022-12-01T17:47:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Faroshad](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/faroshad/32/2103_2.png) [@Faroshad](https://mne.discourse.group/u/Faroshad)\
**Post date:** [December 1, 2022, 5:47pm UTC](https://mne.discourse.group/t/could-not-find-any-of-the-events-you-specified/6023/1 "2022-12-01T17:47:27Z")

</div>

Hello, I have continuous data in which there are no events in my EEG data, but after the process of filtering and cleaning I have some annotations called: ‘Bad\_muscle’. now I can not add these annotations as events. and I think it interrupts my visualization and time-frequency analysis.  
Thank you in advance.

- MNE version: 1.2.2
- operating system: Windows 10

```python
print(raw.annotations)
print(set(raw.annotations.duration))
print(set(raw.annotations.description))
print(raw.annotations.onset[0])

```

**The result of this cell is:**

```python
<Annotations | 39 segments: BAD_muscle (39)>
{0.09666633605957031, 0.026666641235351562, 0.08333206176757812, 0.10333442687988281, 0.043331146240234375, 0.0500030517578125, 0.09666824340820312, 0.1699981689453125, 0.12000274658203125, 0.11333465576171875, 0.08333587646484375, 0.18999481201171875, 0.15332794189453125, 0.086669921875, 0.15000152587890625, 0.10666656494140625, 0.0666656494140625, 0.0699920654296875, 0.2733306884765625, 0.160003662109375, 0.3166656494140625, 0.1300048828125, 0.0966644287109375, 0.1199951171875, 0.2066802978515625, 0.126678466796875, 0.22333526611328125, 0.06667327880859375, 0.21666717529296875, 0.14333343505859375, 0.15999603271484375, 0.14666748046875, 0.05999755859375, 0.35666656494140625, 0.2700042724609375, 0.1866607666015625, 0.07000732421875}
{'BAD_muscle'}
20.29

```

**In the next cell I run:**  
`mne.events_from_annotations(raw)`  
**and the result is the error:**  
`ValueError: Could not find any of the events you specified.`

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [December 1, 2022, 7:53pm UTC](https://mne.discourse.group/t/could-not-find-any-of-the-events-you-specified/6023/2 "2022-12-01T19:53:20Z")

</div>

By default, the annotations starting with `BAD` are ignored. Have a look at the `regexp` argument of `mne.events_from_annotations`.

---

<div class="post-metadata">

**Author:** ![Faroshad](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/faroshad/32/2103_2.png) [@Faroshad](https://mne.discourse.group/u/Faroshad)\
**Post date:** [December 1, 2022, 8:07pm UTC](https://mne.discourse.group/t/could-not-find-any-of-the-events-you-specified/6023/3 "2022-12-01T20:07:03Z")

</div>

Thank you for replying!  
As you said, I change my code to:  
`events, event_id = mne.events_from_annotations(raw, regexp = None)`  
and it worked. Is it ok to use?

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [December 1, 2022, 9:45pm UTC](https://mne.discourse.group/t/could-not-find-any-of-the-events-you-specified/6023/4 "2022-12-01T21:45:39Z")

</div>

Sounds good to me. None probably disables the filtering by name entirely. You could also just change the regex pattern to match `'BAD_muscle'` if that’s the event you want to capture.
