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

Performing cluster sampling

Now that you know when to use cluster sampling, it's time to put it into action. In this exercise, you'll explore the JobRole column of the attrition dataset. You can think of each job role as a subgroup of the whole population of employees.

attrition_pop is available; pandas is loaded with its usual alias, and the random package is available. A seed of 19790801 has also been set with random.seed().

Bu egzersiz

Sampling in Python

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

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create a list of unique JobRole values
job_roles_pop = ____

# Randomly sample four JobRole values
job_roles_samp = ____

# Print the result
print(job_roles_samp)
Kodu Düzenle ve Çalıştır