image_output_1.png
import pandas as pd

df = pd.read_csv('../input/tour-travels-customer-churn-prediction/Customertravel.csv')

df.rename(columns={'Target': 'Churn'}, inplace=True)

df.groupby('Churn').describe()

df.isnull().sum()

df_coded = df.copy()

df_coded = df_coded.replace({'AnnualIncomeClass': {'Low Income': 0, 'Middle Income': 1, 'High Income': 2}})

dummies = ['BookedHotelOrNot', 'AccountSyncedToSocialMedia', 'FrequentFlyer']
df_coded = pd.get_dummies(df_coded, columns=dummies, drop_first=True)

df_coded.rename(columns={'BookedHotelOrNot_Yes': 'BookedHotel', 'AccountSyncedToSocialMedia_Yes': 'AccountSyncedToSocialMedia'}, inplace=True)

df_coded.head(6)