如何在Python-MNE中分析.CSV数据的脑电图(EEG)?

huangapple go评论96阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年3月7日 22:42:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/75663411.html
  • mne-python
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定