【问题标题】:How to read edf data in Python 3如何在 Python 3 中读取 edf 数据
【发布时间】:2018-08-16 04:42:18
【问题描述】:

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

【问题讨论】:

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


【解决方案1】:

我假设您的数据是像 EEG 这样的生物时间序列,这是正确的吗?如果是这样,您可以使用 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

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

【讨论】:

  • 是的。你的假设是正确的。我使用的数据是 EEG 数据。非常感谢你。我已根据您的解决方案成功读取数据,同时在代码“data = mne.io.read_raw_edf(file)”中添加参数“preload=True”。
  • @Mindy 很高兴听到我的回复很有帮助。
猜你喜欢
  • 2020-09-14
  • 1970-01-01
  • 1970-01-01
  • 2012-01-28
  • 1970-01-01
  • 1970-01-01
  • 2023-03-19
  • 2012-03-16
  • 1970-01-01
相关资源
最近更新 更多