python-3.x - AttributeError: 'tuple' object has no attribute 'p_signals'
问题描述
I am stucked in this error any help please. This is my code:
import numpy as np
import pandas as pd
from subprocess import check_output
print(check_output(["ls", "/home/mahmood/apnea-ecg"]).decode("utf8"))
import os
os.listdir("/home/mahmood/apnea-ecg")
import wfdb
import numpy as np
import matplotlib.pyplot as plt
recordname = "/home/mahmood/apnea-ecg/a04"
record = wfdb.rdsamp(recordname)
record.p_signals
解决方案
从wfdb.rdsamp
源代码:
Returns
-------
signals : numpy array
A 2d numpy array storing the physical signals from the record.
fields : dict
A dictionary containing several key attributes of the read
record:
- fs: The sampling frequency of the record
- units: The units for each channel
- sig_name: The signal name for each channel
- comments: Any comments written in the header
因此,您得到一个包含 2 个元素、信号和字段的元组。我只想写:
p_signals, _ = wfdb.rdsamp(recordname)
推荐阅读
- loopbackjs - 输入应用名称后,lb 命令不能更进一步?
- java - 如何导入 com.mojang.authlib.GameProfile
- zabbix - 如何从 Dokku 向 Zabbix 发送日志?
- spring-cloud - spring-cloud-contract 与 spring-jms
- node.js - nodejs 尝试 catch 和 res.status 的使用
- amazon-web-services - 我想逐渐从 Heroku 迁移到 AWS。如何在 Route 53 中设置“加权路由策略”?
- dart - Flutter,发送参数上一屏
- build - 更新到 Visual Studio 15.8.5 后的构建问题
- java - 类 org.apache.commons.compress.archivers.zip.ZipArchiveInputStream 的 InputStream 没有实现 InputStreamStatistics
- exif - exiftool 系统找不到路径