Skip to content

Commit

Permalink
Fixed linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AKuederle committed Mar 17, 2022
1 parent 86a133e commit 0fd4716
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions example_data/ecg_mit_bih_arrhythmia/create_database.py
Expand Up @@ -4,26 +4,31 @@
Note that rerunning might change the pickle files.
However, it is very likely that these changes are only caused by small differences in the compression.
These changes should not be commited to git again.
These changes should not be committed to git again.
"""

from pathlib import Path

import numpy as np
import pandas as pd
import wfdb
import wfdb # noqa: import-error

selected_participants = ["100", "102", "104", "105", "106", "108", "114", "116", "119", "121", "123", "200"]

out_dir = Path(__file__).parent / "data"

for p in selected_participants:
record = wfdb.rdsamp(p, pn_dir='mitdb')
record = wfdb.rdsamp(p, pn_dir="mitdb")
all_data = pd.DataFrame({"ecg": record[0][:, 0]})
anno = wfdb.rdann(p, 'atr', pn_dir='mitdb')
all_r = np.unique(anno.sample[np.in1d(anno.symbol,
['N', 'L', 'R', 'B', 'A', 'a', 'J', 'S', 'V', 'r', 'F', 'e', 'j', 'n', 'E',
'/', 'f', 'Q', '?'])])
anno = wfdb.rdann(p, "atr", pn_dir="mitdb")
all_r = np.unique(
anno.sample[
np.in1d(
anno.symbol,
["N", "L", "R", "B", "A", "a", "J", "S", "V", "r", "F", "e", "j", "n", "E", "/", "f", "Q", "?"],
)
]
)
pvc = np.unique(anno.sample[np.in1d(anno.symbol, ["V"])])
all_r = pd.DataFrame({"R": all_r})
pvc = pd.DataFrame({"PVC": pvc})
Expand Down

0 comments on commit 0fd4716

Please sign in to comment.