python - 如何在 Python 3 中读取 edf 数据
问题描述
如何使用 Python 读取 edf 数据?我想分析 edf 文件的数据,但我无法使用pyEDFlib读取它。它抛出了错误OSError: The file is discontinous and cannot be read
,我不知道为什么。
解决方案
我假设您的数据是像 EEG 这样的生物时间序列,这是正确的吗?如果是这样,您可以使用 MNE 库。
你必须先安装它。由于它不是标准库,请看这里。然后,您可以使用该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
有关数据对象的其他属性,请参阅上面链接中的文档
推荐阅读
- webgl - 图元的Regl颜色和alpha混合
- centos - 我搞砸了我的 bash 配置,但我不确定如何
- r - 在 R 中自定义 LSTM 的初始化器
- bash - 用于检查服务器是否已启动的 Shell 脚本
- c# - System.Net.Http 不适用于 .Net 4.5 应用程序。已添加参考
- javascript - Webpack 不会缩小子文件夹中的 js 文件
- windows - 仅过滤掉 PS 输出中的特定值
- mysql - 我们可以在数据库级别使用 MySql 触发器吗
- php - 当特定产品类别的商品在 Woocommerce 的购物车中时禁用购物
- python - swig 转换标题中的枚举