# How to add events to raw .edf EEG with no stim channel

**URL:** <https://mne.discourse.group/t/how-to-add-events-to-raw-edf-eeg-with-no-stim-channel/5413>\
**Category:** Support & Discussions\
**Tags:** eeg\
**Created:** [August 14, 2022, 2:35pm UTC](https://mne.discourse.group/t/how-to-add-events-to-raw-edf-eeg-with-no-stim-channel/5413 "2022-08-14T14:35:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluesky](https://avatars.discourse-cdn.com/v4/letter/b/e47c2d/32.png) [@bluesky](https://mne.discourse.group/u/bluesky)\
**Post date:** [August 14, 2022, 2:35pm UTC](https://mne.discourse.group/t/how-to-add-events-to-raw-edf-eeg-with-no-stim-channel/5413/1 "2022-08-14T14:35:23Z")

</div>

I want to add a column of events to raw data .csv file of EEG signal with 64 Channel data from .edf file with no STIM channel.

```python
import mne

raw = mne.io.read_raw_edf('../../data\S058\S058R08.edf', preload=True)

montage = mne.channels.make_standard_montage("standard_1020")

raw.rename_channels(lambda s: s.strip("."))

raw.set_montage(montage, match_case=False)

raw.set_eeg_reference("average")

events_from_annot, event_dict = mne.events_from_annotations(raw)

raw.add_events(events_from_annot) #, stim_channel

data = raw.to_data_frame(index="time", time_format="ms")

```

---

<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:** [August 16, 2022, 7:59am UTC](https://mne.discourse.group/t/how-to-add-events-to-raw-edf-eeg-with-no-stim-channel/5413/2 "2022-08-16T07:59:03Z")

</div>

see [https://github.com/mne-tools/mne-python/issues/4208](https://github.com/mne-tools/mne-python/issues/4208)

to add a stim channel first
