text_html_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

df = pd.read_csv('../input/pick_time_warehouse_train.csv')

df.shape

df.columns

df.shape

def remove_outlier(df_in, col_name):
    q1 = df_in[col_name].quantile(0.25)
    q3 = df_in[col_name].quantile(0.75)
    iqr = q3 - q1
    fence_low = q1 - 1.5 * iqr
    fence_high = q3 + 1.5 * iqr
    df_out = df_in.loc[(df_in[col_name] > fence_low) & (df_in[col_name] < fence_high)]
    return df_out
def remove_outlier_cat(df_in, group):
    q1 = group.quantile(0.25)
    q3 = group.quantile(0.75)
    iqr = q3 - q1
    fence_low = q1 - 1.5 * iqr
    fence_high = q3 + 1.5 * iqr
    df_out = df_in.loc[(group > fence_low) & (group < fence_high)]
    return df_out

for i in range(10):
    df = remove_outlier(df, 'Pick_Time')

df.isnull().sum()

fig, ax = plt.subplots(figsize=(15,15))
sns.heatmap(df.corr(),annot=True, linewidths=.5,ax=ax)

for i in np.unique(df['Actual_Quantity']):
    remove_outlier_cat(df, df.groupby(['Actual_Quantity', i]))

df.columns

sns.countplot(df['total_quantity_of_items_in_container'])