Question: Problem #11: 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(82,94).reshape(3,4)
been imported as np. a=0. arange (82,94) - 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 amra where entries are True if the corresponding value of a is even and Fal se 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 even 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 88. (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
Get step-by-step solutions from verified subject matter experts
