Issue
I am facing issues in data path using Jupyter Notebook:
data_path='E:\7th Semester\FYP\mit-bih-arrhythmia-database-1.0.0\mit-bih-arrhythmia-database-1.0.0'
I am experiencing the following error:
OSError Traceback (most recent call last)
<ipython-input-9-22eb7ee6dcc7> in <module>
1 for pt in pts:
2 file = data_path + pt
----> 3 annotation = wfdb.rdann(file, 'atr')
4 sym = annotation.symbol
5
C:\ProgramData\Anaconda3\lib\site-packages\wfdb\io\annotation.py in rdann(record_name, extension, sampfrom, sampto, shift_samps, pn_dir, return_label_elements, summarize_labels)
1625
1626 # Read the file in byte pairs
-> 1627 filebytes = load_byte_pairs(record_name, extension, pn_dir)
1628
1629 # Get WFDB annotation fields from the file bytes
C:\ProgramData\Anaconda3\lib\site-packages\wfdb\io\annotation.py in load_byte_pairs(record_name, extension, pn_dir)
1748 # local file
1749 if pn_dir is None:
-> 1750 with open(record_name + '.' + extension, 'rb') as f:
1751 filebytes = np.fromfile(f, '<u1').reshape([-1, 2])
1752 # PhysioNet file
OSError: [Errno 22] Invalid argument: 'E:\x07th Semester\\FYP\\mit-bih-arrhythmia-database-1.0.0\\mit-bih-arrhythmia-database-1.0.0100.atr'
Solution
Try with double backslashes (or raw strings):
data_path='E:\\7th Semester\\FYP\\mit-bih-arrhythmia-database-1.0.0\\mit-bih-arrhythmia-database-1.0.0'
data_path=r'E:\7th Semester\FYP\mit-bih-arrhythmia-database-1.0.0\mit-bih-arrhythmia-database-1.0.0'
Answered By - frab
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.