英文:
How to do EEG analysis of .CSV data in python-MNE?
问题
我想要做的事情:
我得到了一份经过预处理的EEG数据的CSV文件。
我想在Python-MNE中进行这些分析,但Python-MNE不支持CSV文件格式。
那么,我如何将CSV文件转换成一种数据集文件等,并在Python-MNE中进行分析呢?
英文:
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?
答案1
得分: 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.
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论