1. Learn
  2. /
  3. Courses
  4. /
  5. HR Analytics: Predicting Employee Churn in Python

Connected

Exercise

Getting dummies

You will now transform the department variable, which you know is nominal based on the values you observed. To do that, you will use so-called dummy variables.

Instructions

100 XP
  • get_dummies() out of the department column of the data and save them inside a new DataFrame called departments.
  • Take a quick look at the first 5 rows of the new DataFrame called departments.