Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 2) 5 test cases, 1 point for each passed test case. (5 points total) Using Python in the Jup. Notebook, write a function called
Problem 2) 5 test cases, 1 point for each passed test case. (5 points total) Using Python in the Jup. Notebook, write a function called q summary Vl which takes as input: numbers - a list of numbers The function q summary VI should return a dictionary containing the min, Q1, Q2, Q3, and max. Feel free to utilize the numpy function for quantile instead of implementing the formulas to calculate index positions that we reviewed in class. You will not lose credit for using numpy or for using default python, however, your answers should be correct either way. q_summary_V1 should also warn the user if there are any outliers by printing them to the screen. The following screenshot shows an example function call: These are the two test cases that you should pass to gain 2/5 points as well. grades = sorted([0, 0, 14, 35, 91, 100, 81, 77, 75, 66, 78, 80, 81, 63, 87, 90, 89]) print(q_summary_v1(grades)) The following are outliers: [0, 0, 14] {'min': 35, 'qi': 63.0, '92': 78.0, '93': 87.8, 'max': 100} times = [5, 10, 10, 15, 15, 15, 15, 20, 20, 20, 25, 30, 30, 40, 40, 45, 60, 60, 65, 89] print(q_summary_v1(times)) The following are outliers: [89] {'min': 5, 91': 15.0, '92': 22.5, '93': 41.25, 'max': 65} Problem 2) 5 test cases, 1 point for each passed test case. (5 points total) Using Python in the Jup. Notebook, write a function called q summary Vl which takes as input: numbers - a list of numbers The function q summary VI should return a dictionary containing the min, Q1, Q2, Q3, and max. Feel free to utilize the numpy function for quantile instead of implementing the formulas to calculate index positions that we reviewed in class. You will not lose credit for using numpy or for using default python, however, your answers should be correct either way. q_summary_V1 should also warn the user if there are any outliers by printing them to the screen. The following screenshot shows an example function call: These are the two test cases that you should pass to gain 2/5 points as well. grades = sorted([0, 0, 14, 35, 91, 100, 81, 77, 75, 66, 78, 80, 81, 63, 87, 90, 89]) print(q_summary_v1(grades)) The following are outliers: [0, 0, 14] {'min': 35, 'qi': 63.0, '92': 78.0, '93': 87.8, 'max': 100} times = [5, 10, 10, 15, 15, 15, 15, 20, 20, 20, 25, 30, 30, 40, 40, 45, 60, 60, 65, 89] print(q_summary_v1(times)) The following are outliers: [89] {'min': 5, 91': 15.0, '92': 22.5, '93': 41.25, 'max': 65}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started