Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 examinationStep 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