Question: Task 6 (python code... numpy) Julie scored 85 in Mathematics, 65 in English, 70 in Social Science and 80 in Science. Meanwhile, Tina scored 90

Task 6 (python code... numpy)

Julie scored 85 in Mathematics, 65 in English, 70 in Social Science and 80 in Science. Meanwhile, Tina scored 90 in Mathematics, 60 in English, 80 in Social Science and 75 in Science.

i) Create two arrays to reflect Julie and Tina's scores respectively.

ii) Create an array which holds (boolean values) i.e. the comparison output of their scores. In how many subjects Julie scored more than Tina? Hint: Use the np.argwhere() function.

Task 7

Create an array with the gems listed below. Make it a 3*2 dimensional array.

Gems: ruby, diamond, emerald, jade, sapphire, garnet

i) Print each element of the array using the nested for loop. While printing, the 1st letter of the gem has to be in capital letters.

ii) Print each element of the array using a single for loop. While printing, the 1st letter of the gem has to be in capital letters.

Task 8

Create a two-dimensional array as [[100,200,300],[400,500,600]].

Convert it into a one-dimensional array and print it.

Divide the one-dimensional array by 100 and print the new array. Ensure that the datatype of the new array is int64.

Task 9

Create an array with values 2,4,6 and another array with 8,10,12.

i) Using the functions available in Numpy, create an array using the 2 arrays above such that the result is:

[[ 2, 4, 6],

[ 8, 10, 12]]

ii) Using the functions available in Numpy, create an array using the 2 arrays above such that the result is:

[[ 2, 8],

[ 4, 10],

[ 6, 12]]

Task 10

Create an array of numbers from 1 to 50.

Slice the array to create 3 arrays

i) The 1st array contains numbers 1 to 9.

ii) The 2nd array contains numbers from 10 to 20.

iii) The 3rd array contains numbers from 21 to 50.

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!