Session Ready
Exercise

Percentage of employees who churn

The column churn is providing information about whether an employee has left the company or not is the column churn:

  • if the value of this column is 0, the employee is still with the company
  • if the value of this column is 1, then the employee has left the company

Let’s calculate the turnover rate:

  • you will first count the number of times the variable churn has the value 1 and the value 0, respectively
  • you will then divide both counts by the total, and multiply the result by 100 to get the percentage of employees who left and stayed
Instructions
100 XP
  • Use the len() function to get the total number of observations and save it as the number of employees.
  • Print the number of employees who left and stayed.
  • Print the percentage of employees who left and stayed.