Systematic sampling
One sampling method that avoids randomness is called systematic sampling. Here, you pick rows from the population at regular intervals.
For example, if the population dataset had one thousand rows, and you wanted a sample size of five, you could pick rows 0, 200, 400, 600, and 800.
attrition_pop is available; pandas has been pre-loaded as pd.
Latihan ini adalah bagian dari kursus
Sampling in Python
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
# Set the sample size to 70
sample_size = ____
# Calculate the population size from attrition_pop
pop_size = ____
# Calculate the interval
interval = ____