Traceback (most recent call last): File "D:\Program Files\JetBrains\PyCharm 2023.1\PycharmProject\test\test2.py", line 6, in <module> data = wfdb.rdsamp('D:/下载/ptb-xl-a-large-publicly-available-electrocardiography-dataset-1.0.3/records100/00001', channels=[0]) File "D:\ProgramData\anaconda3\lib\site-packages\wfdb\io\record.py", line 2317, in rdsamp record = rdrecord( File "D:\ProgramData\anaconda3\lib\site-packages\wfdb\io\record.py", line 2029, in rdrecord record = rdheader(record_name, pn_dir=pn_dir, rd_segments=False) File "D:\ProgramData\anaconda3\lib\site-packages\wfdb\io\record.py", line 1839, in rdheader with open( FileNotFoundError: [Errno 2] No such file or directory: 'D:\\下载\\ptb-xl-a-large-publicly-available-electrocardiography-dataset-1.0.3\\records100\\00001.hea' 代码出错
时间: 2023-07-17 22:53:56 浏览: 85
浅谈Python traceback的优雅处理
这个错误提示显示找不到文件`00001.hea`,它是WFDB记录文件的一部分,缺少该文件会导致`rdsamp`函数无法读取信号数据。请确保下载的PTB心电数据集包含相应的`.hea`文件,并且文件名与数据文件名相匹配。如果确实缺少`.hea`文件,请从数据集网站下载相应的文件,并将它们放到正确的文件夹中。
阅读全文