python - 如何在 Python 3 中读取 edf 数据

标签 python time-series european-data-format mne-python

如何使用 Python 读取 edf 数据?我想分析 edf 文件的数据,但我无法使用 pyEDFlib 读取它.它抛出了错误 OSError: The file is discontinous and cannot be read 我不知道为什么。

最佳答案

我假设您的数据是像脑电图这样的生物时间序列,这对吗?如果是这样,您可以使用 MNE 库。

您必须先安装它。由于它不是标准库,所以看看here .然后,您可以使用 read_raw_edf()方法。

例如:

import mne
file = "my_path\\my_file.edf"
data = mne.io.read_raw_edf(file)
raw_data = data.get_data()
# you can get the metadata included in the file and a list of all channels:
info = data.info
channels = data.ch_names

有关数据对象的其他属性,请参阅上面链接中的文档

关于python - 如何在 Python 3 中读取 edf 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51869713/

相关文章:

python - Python Pip Install Wheel 把文件放在哪里

r - 是否有将 EDF 文件导入 R 的现有方法?

python - Pyedflib 读取信号错误

python - 如何在 pandas 0.20.1+ 中重命名多级分组中的所有列

Python Actor 模型 : thespian vs pykka

python - Django Createview外键字段的默认值

r - 按特定时间切割 POSIXct 以获取日常方法

R 为什么 plot.xts 在调用线后创建额外的图形?

python - 使用 Python 的季节性 ARIMA,freq H 不明白?

python - 如何使用 python 读取 edf.event 文件?