IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Sampling in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Set the sample size to 70
sample_size = ____

# Calculate the population size from attrition_pop
pop_size = ____

# Calculate the interval
interval = ____
Modifica ed esegui il codice