0

what I want to do I got csv file of EEG data - after preprocessing. I would like to do these analyses in python-MNE, but python-MNE does not support the csv file format.

So, how can I convert a csv file into a set file etc. and analyze it in python-MNE?

  • can you show a bit of your data? not necessarily the real data, only column names, maybe number of rows, columns. you can upload a screenshot here. [this](https://mne.tools/0.17/manual/io.html#importing-eeg-data) is how you should do it and I may be able to help you if I know the format. – Qasem Nick Mar 07 '23 at 16:24

1 Answers1

3

presuming the data is columns per electrode, you should read the data from csv data = np.genfromtxt('filename.csv',delimiter=','), or using pandas if columns contain channel name header. You should then prepare 'info' that contains channel names, channel types and sampling rate, like this: info = mne.create_info(channel_names, sampling_rate, channel_types), where channel_name and channel_type are lists of strings. You then create a raw object: raw = mne.io.RawArray(data.T, info), the T is to transpose the data to rows-for-channels.

Yuval Harpaz
  • 1,416
  • 1
  • 12
  • 16