text_html_output_1.png
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'])

nom_data = pd.get_dummies(data[['customerID', 'gender', 'MonthlyCharges', 'TotalCharges']], drop_first=True)
nom_data.head()