Reasat/cnn-imi

AttributeError: module 'wfdb' has no attribute 'srdsamp'

Opened this issue · 0 comments

Why is the error occurring?
keys_imi=[]
keys_hc=[]
data={}
segments_hc=0
segments_imi=0
for i,key in enumerate(filepaths):
_,fields=wfdb.srdsamp(key)
if 'Healthy control' in fields['comments'][4]:
segments,label_bin=get_segments(key,[1,2,5])
data[key]=(segments,label_bin)
segments_hc=segments_hc+segments.shape[0]
keys_hc.append(key)
else:
if 'Myocardial infarction' in fields['comments'][4]:
if 'inferior' in fields['comments'][5]:
segments,label_bin=get_segments(key,[1,2,5])
data[key]=(segments,label_bin)
segments_imi=segments_imi+segments.shape[0]
keys_imi.append(key)
print('processed {}/{}'.format(i+1,len(filepaths),),end='\r')
print('\n')
patients_imi=set([key.split(os.path.sep)[-2] for key in keys_imi])
patients_hc=set([key.split(os.path.sep)[-2] for key in keys_hc])
len(patients_imi),len(patients_hc)

AttributeError: module 'wfdb' has no attribute 'srdsamp'