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

import pandas as pd

import seaborn as sns

data = pd.read_csv('../input/HR_comma_sep.csv')

corr = data.corr()
corr = corr
corr

data.loc[data['avg_hour_project'] <= 749.333, 'avg_hour_project'] = 0
data.loc[(data['avg_hour_project'] > 749.333) & (data['avg_hour_project'] <= 1304.667), 'avg_hour_project'] = 1
data.loc[(data['avg_hour_project'] > 1304.667) & (data['avg_hour_project'] <= 1860.0), 'avg_hour_project'] = 2
data.drop(['avg_hour_project_range'], axis=1, inplace=True)

dropdata = data[data['time_spend_company'] >= 8]
data.drop(dropdata.index, inplace=True)

left = data[data['left'] == 1]
not_left = data[data['left'] == 0]
f, axrrr = plt.subplots(1, 2, sharey=True, sharex=True)
axrrr[0].hist('time_spend_company', data=left, bins=10)
axrrr[0].set_title('Left')
axrrr[0].set_xlabel('Time Spend at the Company')
axrrr[0].set_ylabel('Number of Observations')
axrrr[1].hist('time_spend_company', data=not_left, bins=10)
axrrr[1].set_title('Not Left')
axrrr[1].set_xlabel('time_spend_company')
axrrr[1].set_ylabel('Number of Observations')