# Reading and merging events from seperate files with raw data

**URL:** <https://mne.discourse.group/t/reading-and-merging-events-from-seperate-files-with-raw-data/4467>\
**Category:** Support & Discussions\
**Tags:** eeg\
**Created:** [February 24, 2022, 7:26pm UTC](https://mne.discourse.group/t/reading-and-merging-events-from-seperate-files-with-raw-data/4467 "2022-02-24T19:26:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![girijesh97](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/girijesh97/32/1218_2.png) [@girijesh97](https://mne.discourse.group/u/girijesh97)\
**Post date:** [February 24, 2022, 7:26pm UTC](https://mne.discourse.group/t/reading-and-merging-events-from-seperate-files-with-raw-data/4467/1 "2022-02-24T19:26:04Z")

</div>

- MNE version: e.g. 0.24.1
- env - google colab

Hi everyone,  
I am working with an EEG data which is available [here](https://git.scc.kit.edu/pd7949/brainwave-authentication). This folder has three different files which contains EEG data, Events and timestamp. I am able to read EEG data using

> data = mne.io.read\_raw\_edf(file, preload=True)  
> But when I am trying to read events I am getting error something like this

> ValueError: could not convert string to float: 'Latency

I am using the following code to read events and then add to raw data which has been suggested [here](https://github.com/mne-tools/mne-python/issues/4208).

> info = mne.create\_info([‘STI’], data.info[‘sfreq’], [‘stim’])
> 
> stim\_raw = mne.read\_events(‘/content/gdrive/MyDrive/EEG\_Data/brainwave-authentication-main/Dataset/Dataset/studie001\_2019.05.08\_10.15.34-events.txt’, info)
> 
> data.add\_channels([stim\_raw], force\_update\_info=True)

I also tried another method which been mentioned [here](https://mne.tools/stable/auto_tutorials/raw/20_event_arrays.html). But I am getting error while reading the data.  
Please, can anyone suggest how can I read the raw data and add events to it.  
Sorry if this question appears to be naive, as I am very new to brain signals. Any help or suggestion would be highly appreciated.

---

<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:** [March 4, 2022, 11:26am UTC](https://mne.discourse.group/t/reading-and-merging-events-from-seperate-files-with-raw-data/4467/2 "2022-03-04T11:26:29Z")

</div>

I suspect the EDF files are not proper EDF files. You should see if other packages eg PyEDF, PyEDFlib, edfbrowser manage to load them. If not the files are really broken

Alex

---

<div class="post-metadata">

**Author:** ![girijesh97](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/girijesh97/32/1218_2.png) [@girijesh97](https://mne.discourse.group/u/girijesh97)\
**Post date:** [March 9, 2022, 3:17am UTC](https://mne.discourse.group/t/reading-and-merging-events-from-seperate-files-with-raw-data/4467/3 "2022-03-09T03:17:40Z")

</div>

Thanks for the reply, I am able to read these .edf files using MNE and then with some python I am able to filter out each of the events separately, but it’s taking enormous amount of time. I really wish if anyone could suggest a way to do the same with MNE.
