text_plain_output_1.png
from sklearn import preprocessing

import pandas as pd

data = pd.read_csv('../input/stroke-prediction-dataset/healthcare-dataset-stroke-data.csv')

data.drop(['id'], axis=1, inplace=True)

data.isnull().sum()

data.isnull().sum()

from sklearn import preprocessing
label_encoder = preprocessing.LabelEncoder()
data['gender'] = label_encoder.fit_transform(data['gender'])
data['gender'].unique()

data['ever_married'] = label_encoder.fit_transform(data['ever_married'])
data['ever_married'].unique()