This notebook downloads the ECG data from the Physionet QT Database (http://www.physionet.org/physiobank/database/qtdb/) in CSV files.
In order for it to work, you must first install the Physionet WFDB software (http://www.physionet.org/physiotools/wfdb.shtml).
In [1]:
sel_records = [100,102,103,104,114,116,117,123,213,221,223,230,231,232,233,301,302,306,307,308,310,803,808,811,820,821,840,847,853,871,872,873,883,891,16265,16272,16273,16420,16483,16539,16773,16786,16795,17453,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,17152,14046,14157,14172,15814]
sele0_records = [104,106,107,110,111,112,114,116,121,122,124,126,129,133,136,166,170,203,210,211,303,405,406,409,411,509,603,604,606,607,609,612,704]
In [3]:
f = open('rec_names.txt','w')
for i in range(len(sel_records)):
selrecname = 'sel%i' %sel_records[i]
f.write(selrecname + '\n')
for i in range(len(sele0_records)):
sele0recname = 'sele0%i' %sele0_records[i]
f.write(sele0recname + '\n')
f.close()
In [4]:
! cat rec_names.txt
In [ ]:
%%bash
for i in $(cat rec_names.txt); do
rdsamp -r qtdb/$i -c -H -f 0 -t 900 -v -ps >$i.csv
done