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.
Deze oefening maakt deel uit van de cursus
Sampling in Python
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Set the sample size to 70
sample_size = ____
# Calculate the population size from attrition_pop
pop_size = ____
# Calculate the interval
interval = ____