text_html_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

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

df.columns

sales_salary = pd.crosstab(df['sales'], df['salary'], normalize=False)
sales_salary = sales_salary[['low', 'medium', 'high']]
sales_salary['temp'] = sales_salary.index.values
sales_salary.iloc[0, 3] = 'it'
sales_salary.iloc[1, 3] = 'rand_d'
sales_salary.sort_values(by='temp', inplace=True)
sales_salary.set_index('temp', inplace=True)
sales_salary.index.name = 'sales'
sales_salary

df = df.join(pd.get_dummies(df['salary']))
df = df.join(pd.get_dummies(df['sales']), rsuffix='d')
df.drop(labels=['sales', 'salary'], inplace=True, axis=1)

df.drop(labels=['low', 'medium', 'high'], axis=1, inplace=True)
df.head()