You will write functions that build the cumulative frequencies of a table and find its median.
The idea. The cumulative frequency is a running total. The median class is the first class whose total reaches , and .
Your tasks.
cumulative, return the list of running totals of frequencies.median_class, return the position of the median class in the list, counting from .grouped_median, return the median of the table, rounded to decimals. The classes start at the values in lowers and all have the width width.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…