Question: You are going to use the python library numpy to handle the examination score of students. Assume the following code has been executed. 1. (Total

You are going to use the python library numpy to handle theYou are going to use the python library numpy to handle the examination score of students. Assume the following code has been executed.

1. (Total 10 marks) Numpy You are going to use the python library numpy to handle the examination score of students. Assume the following code has been executed. import numpy as np names = np.array( 'Anita', 'Benny', 'Carman', 'Debbie', 'Eric', 'Fred', 'Gil', 'Helen', 'Iris', June', 'Kate', 'Louis']) score_list = [78, 34, 90, 19, 80, 77, 55, 54, 92.8, 89, 32, 77] (a) (1 mark) Create a numpy array named 'scores' using the list 'score_list'. (b) (1 mark) Print the data type of the data stores in the array 'scores! (c) (1 mark) Convert the data type of the data stores in 'scores to the type 'int'. (d) (2 marks) It is found that the scores of the students should be represented using a value between 0 and 1. Perform the conversion on the array 'scores' by dividing each of the item values by 100. (e) (2 marks) Create a mask named 'fail_scores_mask which is a boolean index array showing whether the corresponding item in 'scores' is less than 0.5. (f) (3 marks) Apply the mask 'fail_scores_mask' created in part (e) to the array 'names' to show the students who have passed the examination

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!