text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

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

df = df.drop(['Unnamed: 0', 'id'], axis=1)

sns.set_style('whitegrid')
sns.set_context('paper', font_scale=1.4)

test = pd.read_csv('../input/airline-passenger-satisfaction/test.csv')
test = test.drop(['Unnamed: 0', 'id'], axis=1)

sns.set_style('whitegrid')
sns.set_context('paper', font_scale=1.4)

sns.set_style('whitegrid')
sns.set_context('paper', font_scale=1.5)

sns.set_style('whitegrid')
sns.set_context('paper', font_scale=1.5)

# Graphs of satisfaction customers by Class, Customer Type and Type of Travel.

sns.set_style('whitegrid')
fig, ax = plt.subplots(1,3, figsize=(18,16))
sns.set_context('paper', font_scale=1.5)

ax[0].set_title('Customer Satisfaction by Class')
sns.countplot(x='satisfaction', data = df, hue = 'Class', ax=ax[0])

ax[1].set_title('Customer Satisfaction by Customer Type')
sns.countplot(x='satisfaction', data = df, hue = 'Customer Type', ax=ax[1])

ax[2].set_title('Customer Satisfaction by Type of Travel')
sns.countplot(x='satisfaction', data = df, hue = 'Type of Travel', ax=ax[2])

sns.set_style('whitegrid')
sns.set_context('paper', font_scale=1.4)
crash_mx = df.corr()

df_s = df[(df['satisfaction'] != 'neutral or dissatisfied') & (df['Class'] != 'Business')].describe()
df_nds = df[(df['satisfaction'] == 'neutral or dissatisfied') & (df['Class'] != 'Business')].describe()
df_s_mean = df_s[1:2][['Inflight wifi service', 'Departure/Arrival time convenient', 'Ease of Online booking', 'Gate location', 'Food and drink', 'Online boarding', 'Seat comfort', 'Inflight entertainment', 'On-board service', 'Leg room service', 'Baggage handling', 'Checkin service', 'Inflight service', 'Cleanliness']]
df_s_mean = df_s_mean.rename(index={'mean': 'satisfied'})
df_nds_mean = df_nds[1:2][['Inflight wifi service', 'Departure/Arrival time convenient', 'Ease of Online booking', 'Gate location', 'Food and drink', 'Online boarding', 'Seat comfort', 'Inflight entertainment', 'On-board service', 'Leg room service', 'Baggage handling', 'Checkin service', 'Inflight service', 'Cleanliness']]
df_nds_mean = df_nds_mean.rename(index={'mean': 'neutral or dissatisfied'})
final_mean = pd.concat([df_nds_mean, df_s_mean])
final_mean