text_plain_output_1.png
from sklearn.preprocessing import LabelEncoder

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

df = pd.read_csv('../input/insurance/insurance.csv')

df.isnull().sum()

le = LabelEncoder()
df['le_region'] = le.fit_transform(df.region)
df['le_smoker'] = le.fit_transform(df.smoker)
df['le_sex'] = le.fit_transform(df.sex)
df.head()