text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

passengers = pd.read_csv('../input/airline-passenger-satisfaction/airline_passenger_satisfaction.csv', sep=',', encoding='utf-8')

passengers.columns

passengers.shape

nulls = passengers.isnull().sum()
nulls

passengers.duplicated().sum()

data = passengers.copy()
data.drop('ID', axis=1, inplace=True)

data.isnull().sum()

fill_list = data['Arrival Delay'].dropna()
data['Arrival Delay'] = data['Arrival Delay'].fillna(pd.Series(np.random.choice(fill_list, size=len(data.index))))

data.isnull().sum()

data.shape

data = data[data['Flight Distance'] < 4000]

data.shape