Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following numpy array a and answer the questions in each part below. Assume that numpy has been imported as np. a=np.arange(47,59).reshape(3,4) Note: If

image text in transcribed Consider the following numpy array a and answer the questions in each part below. Assume that numpy has been imported as np. a=np.arange(47,59).reshape(3,4) Note: If you are not getting an answer accepted by childsmath, try using code similar in style to the commands given in question 10 above. (a) Write a single line of code which will print a two-dimensional array where entries are True if the corresponding value of a is odd and False if it is not. (b) Write a single line of code which will print a one-dimensional array of only the even numbers of a. (c) Write a single line of code which which replaces all odd numbers of a with 0 . (d) Write a single line of code which computes the sum of all values from a which are less than 53. (e) Complete the code below so that it accomplishes the same task as in part (d)

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

Step: 3

blur-text-image

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

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions

Question

How is the actual price of a bond determined? Give an example.

Answered: 1 week ago