Reputation: 1
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?
Upvotes: 0
Views: 706
Reputation: 1426
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.
Upvotes: 4