Jwoo5/fairseq-signals

Data problrm

DanMerry opened this issue · 2 comments

I have another problem, How to load the data of ecg-id using python?
image

Jwoo5 commented

Sorry for the late reply.
You can load ecg-id data by using simple python code lines as follows:

import wfdb
record = wfdb.rdrecord("rec_1")
annot = wfdb.rdann("rec_1", "atr")

Note that raw ECG signal values are stored in record.__dict__["p_signal"], and the first index (record.__dict__["p_signal"][:, 0]) is for a raw signal and the second index (record.__dict__["p_signal"][:, 1]) is for a filtered signal.

ths very much