EEG data csv file preprocessing

How can I load my local eeg dataset and work with it ?
My eeg dataset is in csv file howa can i work with it !

Hello @abirmh1 and welcome to the forum!

Unfortunately, you’re neither providing enough information to allow us to really help you with your concrete question, nor did you follow the instructions given in the posting template. So we cannot know what exactly you want to do, what you’ve tried, and not even which version of MNE-Python you’re using.

All I can do is give you a general pointer to our docs:
https://mne.tools/stable/auto_tutorials/io/10_reading_meg_data.html#creating-mne-data-structures-from-arbitrary-data-from-memory

And you can use the search function of the forum and search for “csv”.

Good luck,
Richard

Hi, I’m working with Epoc + (14 channels), my EEG data is in a .csv file. I need to upload it and do the preprocessing with it . Is this possible with MNE Python ?
I trying this : raw = mne.fiff.Raw(raw_fname) but doesnt work !
I use the last version of MNE

If the data is in .csv format, this is a general storage format. You can use pandas to import the csv file into a dataframe, then convert the values into an MNE raw object. The emotiv website says that the sampling rate is defined on the first line - you will need that when defining the info structure.

More info on making the raw mne structure
https://mne.tools/stable/auto_tutorials/simulation/10_array_objs.html

import pandas as pd
import mne
dataframe = pd.read_csv('Data.csv', skip_rows=1) 

#From the link above - there is more info on how to define channel type etc for info structure
n_channels = len(dataframe.columns)    
sampling_freq = ???  # in Hertz - This is in the first line of the CSV
info = mne.create_info(n_channels, sfreq=sampling_freq)
raw = mne.io.RawArray(dataframe.values, info)  

#...preprocessing ...
raw.save('Data.fif')

This gets you started, but you may want to define the channel types.
Once imported as an mne raw structure, you can do all the preprocessing of the data.

3 Likes