Datasets:
Upload arhythmia.py
Browse files- arhythmia.py +2 -0
arhythmia.py
CHANGED
@@ -350,6 +350,8 @@ class Arrhythmia(datasets.GeneratorBasedBuilder):
|
|
350 |
def preprocess(self, data: pandas.DataFrame, config: str = DEFAULT_CONFIG) -> pandas.DataFrame:
|
351 |
data = data[(data.t != "?") & (data.qrst != "?") & (data.p != "?") & (data.j != "?") & (data.heart_rate != "?")]
|
352 |
data = data.astype({"t": int, "qrst": int, "p": int, "j": int, "heart_rate": int})
|
|
|
|
|
353 |
|
354 |
print(list(data.columns))
|
355 |
print("type_of_arhythmia" in data.columns)
|
|
|
350 |
def preprocess(self, data: pandas.DataFrame, config: str = DEFAULT_CONFIG) -> pandas.DataFrame:
|
351 |
data = data[(data.t != "?") & (data.qrst != "?") & (data.p != "?") & (data.j != "?") & (data.heart_rate != "?")]
|
352 |
data = data.astype({"t": int, "qrst": int, "p": int, "j": int, "heart_rate": int})
|
353 |
+
if "type_of_arrhythmia" in data.columns:
|
354 |
+
data = data.rename(columns={"type_of_arrhythmia": "type_of_arhythmia"})
|
355 |
|
356 |
print(list(data.columns))
|
357 |
print("type_of_arhythmia" in data.columns)
|