text_html_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

employees = pd.read_csv('../input/ibm-hr-analytics-attrition-dataset/WA_Fn-UseC_-HR-Employee-Attrition.csv')

employees.shape

employees.dtypes

employees.isnull().sum()

employees.duplicated().sum()

sns.set_style('darkgrid')

employees.drop(['EmployeeCount', 'StandardHours', 'Over18', 'EmployeeNumber'], axis=1, inplace=True)

left = employees[employees['Attrition'] == 1]
stayed = employees[employees['Attrition'] == 0]

correlations = employees.corr()
f, ax = plt.subplots(figsize = (20,20))
sns.heatmap(correlations, annot=True);

sns.set_palette('seismic_r')

pd.options.plotting.backend = 'plotly'

plt.figure(figsize=(12, 7))
sns.kdeplot(left['DistanceFromHome'], label='Employees that left', shade=True, color='k')
sns.kdeplot(stayed['DistanceFromHome'], label='Employees that stayed', shade=True, color='b')