BaşlayınÜcretsiz Başlayın

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.

Bu egzersiz

HR Analytics: Predicting Employee Churn in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • 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.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Get dummies and save them inside a new DataFrame
departments = pd.____(____.department)

# Take a quick look to the first 5 rows of the new DataFrame called departments
print(____.____())
Kodu Düzenle ve Çalıştır