加载MIT-BIH心律失常数据库
加载MIT-BIH心律失常数据库
请问使用哪种文件格式最佳,并且如何正确加载数据库并在Python中绘制信号图?我正在使用https://physionet.org/physiobank/database/mitdb/上的.dat文件。我使用了以下代码:
import numpy as np import matplotlib.pyplot as plt data = np.genfromtxt('100.dat',delimiter=',') print(data)
但是我遇到了以下错误:
*line 1867, in genfromtxt raise ValueError(errmsg) ValueError: Some errors were detected ! Line #3 (got 2 columns instead of 1) Line #6 (got 4 columns instead of 1) Line #9 (got 3 columns instead of 1) Line #11 (got 3 columns instead of 1) Line #12 (got 2 columns instead of 1) Line #16 (got 3 columns instead of 1) Line #17 (got 2 columns instead of 1) Line #18 (got 3 columns instead of 1) Line #20 (got 2 columns instead of 1) Line #23 (got 2 columns instead of 1) Line #27 (got 2 columns instead of 1) Line #36 (got 2 columns instead of 1) Line #37 (got 2 columns instead of 1) Line #66 (got 2 columns instead of 1) Line #67 (got 2 columns instead of 1) Line #100 (got 2 columns instead of 1) Line #105 (got 2 columns instead of 1) Line #106 (got 2 columns instead of 1) Line #118 (got 2 columns instead of 1) Line #120 (got 5 columns instead of 1) Line #122 (got 3 columns instead of 1) Line #123 (got 4 columns instead of 1) Line #125 (got 2 columns instead of 1) Line #126 (got 2 columns instead of 1) Line #127 (got 3 columns instead of 1) Line #128 (got 2 columns instead of 1) Line #134 (got 2 columns instead of 1) Line #135 (got 2 columns instead of 1) Line #137 (got 2 columns instead of 1) Line #141 (got 3 columns instead of 1) Line #143 (got 3 columns instead of 1) Line #146 (got 2 columns instead of 1) Line #147 (got 2 columns instead of 1) Line #148 (got 2 columns instead of 1) Line #149 (got 2 columns instead of 1) Line #152 (got 3 columns instead of 1) Line #154 (got 2 columns instead of 1) Line #156 (got 4 columns instead of 1) Line #162 (got 2 columns instead of 1) Line #163 (got 2 columns instead of 1) Line #167 (got 3 columns instead of 1) Line #168 (got 2 columns instead of 1) Line #174 (got 2 columns instead of 1) Line #175 (got 2 columns instead of 1) Line #176 (got 3 columns instead of 1) Line #177 (got 2 columns instead of 1) Line #179 (got 2 columns instead of 1) Line #186 (got 2 columns instead of 1) Line #187 (got 3 columns instead of 1) Line #188 (got 2 columns instead of 1) Line #189 (got 3 columns instead of 1) Line #191 (got 2 columns instead of 1) Line #193 (got 2 columns instead of 1) Line #196 (got 2 columns instead of 1) Line #199 (got 2 columns instead of 1) Line #202 (got 2 columns instead of 1) Line #203 (got 2 columns instead of 1) Line #204 (got 2 columns instead of 1) Line #209 (got 4 columns instead of 1) Line #210 (got 4 columns instead of 1) Line #211 (got 2 columns instead of 1) Line #213 (got 2 columns instead of 1) Line #218 (got 2 columns instead of 1) Line #222 (got 2 columns instead of 1) Line #223 (got 3 columns instead of 1) Line #228 (got 2 columns instead of 1) Line #236 (got 2 columns instead of 1) Line #240 (got 2 columns instead of 1) Line #241 (got 2 columns instead of 1) Line #244 (got 3 columns instead of 1) Line #246 (got 2 columns instead of 1) Line #255 (got 2 columns instead of 1) Line #257 (got 2 columns instead of 1) Line #268 (got 2 columns instead of 1) Line #269 (got 2 columns instead of 1) Line #271 (got 2 columns instead of 1) Line #273 (got 4 columns instead of 1) Line #280 (got 2 columns instead of 1) Line #281 (got 2 columns instead of 1) Line #291 (got 2 columns instead of 1) Line #323 (got 2 columns instead of 1) Line #325 (got 2 columns instead of 1) Line #334 (got 2 columns instead of 1) Line #340 (got 2 columns instead of 1) Line #341 (got 2 columns instead of 1) Line #342 (got 2 columns instead of 1) Line #364 (got 2 columns instead of 1) Line #372 (got 3 columns instead of 1) Line #375 (got 2 columns instead of 1) Line #378 (got 6 columns instead of 1)*