1.查看所有数据库
import wfdb
dbs = wfdb.get_dbs()
print(dbs)
2.获取数据库中的所有记录
import wfdb
recs_list = wfdb.get_record_list('wrist')
print(recs_list)
3.读取某一列数据,并到放到csv文件中
import wfdb
import matplotlib.pyplot as plt
import numpy as np
chest_ecg, wrist_ppg = wfdb.rdsamp('../wrist/s1_high_resistance_bike', channels=[0, 1], sampfrom=0, sampto=15000)
print('chest_ecg:', chest_ecg)
np.savetxt("temp.csv", chest_ecg, delimiter=",")
print('wrist_ppg:', wrist_ppg)
plt.plot(chest_ecg)
plt.ylabel(wrist_ppg['units'][0])
plt.legend([wrist_ppg['sig_name'][0], wrist_ppg['sig_name'][1]])
plt.show()
附:参考文章
https://blog.csdn.net/weixin_44191286/article/details/86305591
https://www.jianshu.com/p/4e3a3bd49dc8