project data wrangling
What is Data Analytics?
Part 1: Choosing a Dataset:
I choose a dataset from the Kaggle. The name of my dataset is Stroke Prediction Dataset and my dataset consists of the following specifications:
1. It has 12 columns.
2. It has 5110 rows.
3. It is labeled data.
Part 2: Dataset Background
Summary
This data comes from the electronic records of the patients that are released by Mckinsey & company. The electronic record of the patients such as he/she is suffered from heart disease, hypertension etc. predicts that the patient has stroke or not.
Many people suffer in the disease of stroke but they don't know that they suffer in stroke. Using the machine learning algorithms, we can tell the patients that he/she suffer in stroke disease. These predictions help patients to know that in which disease they suffer? Are they suffer in stroke or not? In this way, we can solve the problems of the patients and we can solve the problems of the people also. We can solve the problems of World.
Part 3: Dataset Info
This dataset contains the records of 5110 patients and 12 fields. It consists of 11 input attributes and 1 output attribute. There are 11 input attribute that is: id, age, gender, hypertension (binary attribute: 0 means patient does not have hypertension, 1means patient has hypertension), heart disease (binary attribute: 0 means patient does not have any heart disease, 1means patient has a heart disease), marital_status, work_type, residence_type, average_glucose_level, body_mass_index (BMI) and smoking_status of the patient. The 12 output attribute is stroke that predicts whether the patient had a stroke or not.
The following table shows column name, Data Type and numeric or categorical types of data.
|
Column Name |
Data Type |
Numeric/Categorical |
|
Id |
Int64 |
Numeric |
|
Gender |
Object |
Categorical |
|
Age |
Float64 |
Numeric |
|
Hypertension |
Int64 |
Numeric |
|
Heart Disease |
Int64 |
Numeric |
|
Marital_Status |
Object |
Categorical |
|
Work_Type |
Object |
Categorical |
|
Residence_Type |
Object |
Categorical |
|
Average_Glucose_Level |
Float64 |
Numeric |
|
Body_Mass_Index |
Float64 |
Numeric |
|
Smoking_Status |
Object |
Categorical |
|
Stroke |
Int64 |
Numeric |
Part 4: Import your Dataset
We use Jupyter Notebook to import this dataset. We follow some steps to import the dataset.
1. First of all, we import the pandas library that is as follows:
2. We import this dataset by using the function pd.read_csv( ). The screenshot of the following code is as follows:
3. We print the dataset using the head function that is as follows:
4. Now, we describe the information of the dataset using the info() function. The code of the following function is as follows:
5. The, we describe the shape of the dataset using the function that is as follows: