You will write three functions. The first turns a list into z-scores. The second finds the share of values within standard deviations. The third turns a z-score back into a value. Use the population SD, statistics.pstdev.
The idea. . A value is within SDs when . Going back, .
Your tasks.
z_scores(data). Return the list of z-scores.share_within(data, k). Return the fraction of values with .value_from_z(z, mean, sd).Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…