Question
The purpose of this assignment is to assess student's ability in utilizing NumPy and Pandas libraries. There are three questions in the assignment, and you
The purpose of this assignment is to assess student's ability in utilizing NumPy and Pandas libraries. There are three questions in the assignment, and you are asked to fulfill all the requirements. Use comments to explain your code. The answers should be your own. Use (Rafid) to submit your files (2 screenshots for Q1 and Q2 stored in jpg format + a notebook file .ipynb for Q3) all the files should be compressed in a .ZIP file. The notebook file must Contain a program header (a comment OR text block at the top of the notebook that includes your name, studentID, the date, and a brief description of your solution). An appropriate level of comments. Follow the usual Python naming conventions (search about it).
When submitting work, it is your responsibility to ensure that all work submitted is Consistent with stated requirements Entirely your own work On time
Please note that there are severe penalties for submitting work which is not your own. If you have used code which you have found on the Internet or from any other source, then you must signal that fact with appropriate program comments. compete the code
import numpy as np
marks_Master = np.array([[95, 99, 91], [95, 90, 100]])
#A
print('shape of array :', marks_Master.shape)
print('shape of array :', marks_Master.dtype)
print('-------')
#B
np_mean=(marks_Master[1:, 1:])
print(np.mean(np_mean))
print('-------')
#c
marks_Master[::].sort()
print(marks_Master)
Define a 2d array that stores your marks in the Master program (1st row for 1st term, 2nd row for 2nd term,....,etc.). Then do the following: A. Print out the shape of the array, and the datatype of its element. B. Slice the last two marks in the last term and print out their average. C. Sort the array in descending order. D. Flatten the array and define a new array that uses if condition to store true if the mark is larger or equal to 60 or store false otherwise. NOTE: your current term's marks may still lower than 60 until now. e.g. array after being flatten ([95,93,80,44,36,32]). The new array should be like: ([True, True,True False, False, False]). E. Reshape the flattened array to be 3X2 shape. *** THE END *** 2
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