Heart-disease-prediction-system
Description:
Here 4 stages , diseased or not and also 2 stages
1st row - age
2 row - male or female (1 - male)
3 - chest pain CP
cp: chest pain type
-- Value 1: typical angina(Chest portion)
-- Value 2: atypical angina
-- Value 3: non-anginal pain
-- Value 4: asymptomatic
4 - trestbps: resting blood pressure (in mm Hg on admission to the
hospital)
5 - chol: serum cholestoral in mg/dl
6 - fbs: (fasting blood sugar > 120 mg/dl) (1 = true; 0 = false)
7 - restecg: resting electrocardiographic results
-- Value 0: normal
-- Value 1: having ST-T wave abnormality (T wave inversions and/or ST
elevation or depression of > 0.05 mV)
-- Value 2: showing probable or definite left ventricular hypertrophy
by Estes' criteria
8 - thalach: maximum heart rate achieved
9 - exang: exercise induced angina (1 = yes; 0 = no)
10 - oldpeak = ST depression induced by exercise relative to rest
11 - slope: the slope of the peak exercise ST segment
-- Value 1: upsloping
-- Value 2: flat
-- Value 3: downsloping
12 - ca: number of major vessels (0-3) colored by flourosopy
13 - thal: 3 = normal; 6 = fixed defect; 7 = reversable defect
14 - num: diagnosis of heart disease (angiographic disease status)
-- Value 0: < 50% diameter narrowing
-- Value 1: > 50% diameter narrowing
(in any major vessel: attributes 59 through 68 are vessels)
Program:
from numpy import *
# remember row in excel is column in real life
# Just change the row name to find whether in a particular row has empty elements or not . Eg
row[11]
import csv
inp = open('D:\Python\Heart Disease\[Link]','r')
out = open('D:\Python\Heart Disease\[Link]','w')
writer = [Link](out)
for row in [Link](inp):
if(row[11] >= "0" and row[12] >= "0"):
[Link](row)
print(out)
[Link]()
[Link]()
Data:
Graph: