Datasets:
Upload heart.py
Browse files
heart.py
CHANGED
@@ -184,25 +184,26 @@ class Heart(datasets.GeneratorBasedBuilder):
|
|
184 |
|
185 |
data = data.infer_objects()
|
186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
for f in data.columns:
|
188 |
if "?" in data[f].values:
|
189 |
print(f)
|
190 |
-
data = data["resting_blood_pressure" != "?"]
|
191 |
-
data = data["fasting_blood_sugar" != "?"]
|
192 |
-
data = data["rest_electrocardiographic_type" != "?"]
|
193 |
-
data = data["maximum_heart_rate" != "?"]
|
194 |
-
data = data["has_exercise_induced_angina" != "?"]
|
195 |
data = data.astype({"is_male": bool, "has_exercise_induced_angina": bool,
|
196 |
"serum_cholesterol": float, "maximum_heart_rate": float,
|
197 |
"resting_blood_pressure": float, "fasting_blood_sugar": float})
|
198 |
else:
|
199 |
data = data[data.thal != "?"]
|
200 |
data = data[data.number_of_major_vessels_colored_by_flourosopy != "?"]
|
201 |
-
data = data[
|
202 |
-
data = data[
|
203 |
-
data = data[
|
204 |
-
data = data[
|
205 |
-
data = data[
|
206 |
|
207 |
for f in data.columns:
|
208 |
if "?" in data[f].values:
|
|
|
184 |
|
185 |
data = data.infer_objects()
|
186 |
|
187 |
+
data = data[data.resting_blood_pressure != "?"]
|
188 |
+
data = data[data.fasting_blood_sugar != "?"]
|
189 |
+
data = data[data.rest_electrocardiographic_type != "?"]
|
190 |
+
data = data[data.maximum_heart_rate != "?"]
|
191 |
+
data = data[data.has_exercise_induced_angina != "?"]
|
192 |
+
|
193 |
for f in data.columns:
|
194 |
if "?" in data[f].values:
|
195 |
print(f)
|
|
|
|
|
|
|
|
|
|
|
196 |
data = data.astype({"is_male": bool, "has_exercise_induced_angina": bool,
|
197 |
"serum_cholesterol": float, "maximum_heart_rate": float,
|
198 |
"resting_blood_pressure": float, "fasting_blood_sugar": float})
|
199 |
else:
|
200 |
data = data[data.thal != "?"]
|
201 |
data = data[data.number_of_major_vessels_colored_by_flourosopy != "?"]
|
202 |
+
data = data[data.resting_blood_pressure != "?"]
|
203 |
+
data = data[data.fasting_blood_sugar != "?"]
|
204 |
+
data = data[data.rest_electrocardiographic_type != "?"]
|
205 |
+
data = data[data.maximum_heart_rate != "?"]
|
206 |
+
data = data[data.has_exercise_induced_angina != "?"]
|
207 |
|
208 |
for f in data.columns:
|
209 |
if "?" in data[f].values:
|