Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions Perform the tasks and answer the questions using Python code ( Jupyter notebook ) . Display results when applicable. Take screenshots of your work

Instructions
Perform the tasks and answer the questions using Python code (Jupyter notebook). Display results when applicable. Take screenshots of your work and paste them.
To start performing each task, import the Numpy library and give it an appropriate alias name. Find the version of the Numpy package on your system.
Task 1A
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 2A
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 3A
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 4A
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 5A
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

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_2

Step: 3

blur-text-image_3

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

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

Students also viewed these Databases questions