Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 2 50 Points Due date: Feb 24th, 2021 Answer the following question based on using Python Numpy Library: Question 2 (10 Points) Following are

image text in transcribed
image text in transcribed
Assignment 2 50 Points Due date: Feb 24th, 2021 Answer the following question based on using Python Numpy Library: Question 2 (10 Points) Following are the average monthly temperature of Baltimore. Min Max Jan 30.5 482 Feb 38.4 50.3 March 48.1 58.7 April 56.8 61.9 May 65.2 70.5 June 75.9 82.4 July 83.6 882 Aug 86.5 93.1 Sep 75.3 86.7 Oct 64.6 77.5 Nov 58.1 672 Dec 45.4 53.6 a) Store the above information in a NumPy array b) Calculate the mean, highest and fowest temperature from the above array. c) What is the average min and max temperatures in the last quarter (Oct-Dec) of the year d) Use a dot product operation to print the average temperature ((min-max)2) of each month. Question 3 (30 points) 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 I 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. 1) Test your function on three arrays of different shapes. 9) 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. O Assignment 2 50 Points Due date: Feb 24th, 2021 Answer the following question based on using Python Numpy Library: Question 2 (10 Points) Following are the average monthly temperature of Baltimore. Min Max Jan 30.5 482 Feb 38.4 50.3 March 48.1 58.7 April 56.8 61.9 May 65.2 70.5 June 75.9 82.4 July 83.6 882 Aug 86.5 93.1 Sep 75.3 86.7 Oct 64.6 77.5 Nov 58.1 672 Dec 45.4 53.6 a) Store the above information in a NumPy array b) Calculate the mean, highest and fowest temperature from the above array. c) What is the average min and max temperatures in the last quarter (Oct-Dec) of the year d) Use a dot product operation to print the average temperature ((min-max)2) of each month. Question 3 (30 points) 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 I 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. 1) Test your function on three arrays of different shapes. 9) 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. O

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions