MIMIC重症监护病房python中wfdb包的使用

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

  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值