<jupyter_start><jupyter_text>Additional data cleaning for ml<jupyter_code># import libraries
import pandas as pd
import numpy as np
from path import Path

import warnings
warnings.filterwarnings('ignore')
#load data
data = Path('./Resources/cleaned_stroke_dataset.csv')
stroke_df = pd.read_csv(data)
stroke_df.head()
# drop index
stroke_df = stroke_df.drop('work_type', axis=1)
stroke_df = stroke_df.drop('bmi', axis=1)
stroke_df = stroke_df.drop('avg_glucose_level', axis=1)
stroke_df = stroke_df.drop('Residence_type', axis=1)
stroke_df.head()
#reorder dataframe
stroke_df = stroke_df.reindex(['age', 'gender', 'ever_married', 'smoking_status', 'hypertension', 'heart_disease', 'stroke'], axis=1)
#rename
stroke_df.rename(columns={'age': 'Age', 'gender': 'Gender', 'ever_married': 'Ever Married', 
                         'smoking_status': 'Smoking Status', 'hypertension': 'Hypertension',
                        'heart_disease': 'Heart Disease', 'stroke': 'Stroke'}, inplace=True)
stroke_df.head()
# export clean dataset
stroke_df.to_csv('ml_clean_stroke_dataset.csv', index=False)<jupyter_output><empty_output>