application_vnd.jupyter.stderr_output_1.png
from sklearn.preprocessing import OneHotEncoder

import pandas as pd

df = pd.read_csv('/kaggle/input/airways-customer-data/filtered_customer_booking.csv', index_col=0)

df = df.reset_index(drop=True)

df_final = df

from sklearn.preprocessing import OneHotEncoder
encoder = OneHotEncoder(handle_unknown='ignore')
encoder_df = pd.DataFrame(encoder.fit_transform(df[['sales_channel']]).toarray())
encoder_df = encoder_df.rename(columns={0: 'Internet', 1: 'Mobile'})
df_final = df_final.join(encoder_df)
encoder_df = pd.DataFrame(encoder.fit_transform(df[['trip_type']]).toarray())
encoder_df = encoder_df.rename(columns={0: 'RoundTRip', 1: 'OneWayTrip', 2: 'CircleTrip'})
df_final = df_final.join(encoder_df)

df_final.drop(['sales_channel', 'trip_type', 'booking_origin', 'route'], axis=1, inplace=True)

df_final = df_final.drop('booking_complete', axis=1)

df_final