text_html_output_1.png
import pandas as pd

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

pd.set_option('display.float_format', '{:.2f}'.format)

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

categorical_col = []
for column in df.columns:
    if df[column].dtype == object and len(df[column].unique()) <= 50:
        categorical_col.append(column)

df['Attrition'] = df.Attrition.astype('category').cat.codes

df.Attrition.value_counts()