Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use NumPy random-number generation to create an array of 30 random grades in the range of 60 through 100, then reshape the result into a
Use NumPy random-number generation to create an array of 30 random grades in the range of 60 through 100, then reshape the result into a 10-by-3 array (which will actually represent the Midterm 1, Midterm 2 and Final grade of 10 students) a) Calculate the average of all the grades. b) Calculate the average of the grades in each column and each row. c) Calculate the average of the grade of the first two and last two students. d) Calculate the average of Midterm 1 and Midterm 2 grades of the first 5 students. e) Write functions median and mode that use existing NumPy capabilities to determine the median (middle) and mode (most frequent) of the values in the array f) Test your function on three arrays of different shapes. g) Modify your functions to allow the user to provide an axis keyword argument so the calculations can be performed row-by-row or column-by- column on the above two-dimensional array
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