text_plain_output_1.png
import matplotlib.pyplot as plt

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

import seaborn as sns

df = pd.read_csv('../input/airline-passenger-satisfaction/train.csv')
test = pd.read_csv('../input/airline-passenger-satisfaction/test.csv')
(df.shape, test.shape)

df_all = df.append(test)
df_all.shape

df_all.head(10).T

df_all.columns = [c.replace(' ', '_') for c in df_all.columns]

df_all.isna().sum()

df_all = df_all.drop('Unnamed:_0', axis=1)
df_all = df_all.drop('id', axis=1)

df_all.describe().round(2)

import seaborn as sns
import matplotlib.pyplot as plt
plt.tight_layout

# Checando o desbalanceamento 

fig = plt.figure(figsize = (8,5))
df_all.satisfaction.value_counts(normalize = True).plot(kind='bar', color= ['darkorange','steelblue'], alpha = 0.9, rot=0)
plt.show()

df_all = pd.get_dummies(df_all, columns=['Gender', 'Customer_Type', 'Type_of_Travel', 'Class'])
df_all

df_all.head().T

df_all.info()