text_html_output_1.png
from sklearn.preprocessing import LabelEncoder

from sklearn.preprocessing import OneHotEncoder,LabelEncoder, OrdinalEncoder

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

data = pd.read_csv('/kaggle/input/telco-customer-churn/WA_Fn-UseC_-Telco-Customer-Churn.csv')

data.columns

data.isnull()

data.shape

data.isnull().sum()

data.fillna(data.mean())

data.select_dtypes(include='int')

num_data = data.select_dtypes(include=['int', 'float'])

data.drop(columns=['Partner'])

data.drop(columns=['gender', 'tenure', 'TotalCharges'])

from sklearn.preprocessing import LabelEncoder
l = LabelEncoder()
data['MonthlyCharges'] = l.fit_transform(data['MonthlyCharges'])

y = data.Churn

le = LabelEncoder()
y = le.fit_transform(y)
y