Question: Perform the operations listed below on the NumPy array q 1 = np . array ( [ 2 , 3 , 5 , 7 ,

Perform the operations listed below on the NumPy array q1= np.array([2,3,5,7,9]). All operations should be considered independently. All returned arrays should be of the same size as q1. Use broadcasting and slicing wherever possible [Course Objective #3]:
a. Triple every value in q1, store the result in the array q1a.
b. Half every other value in q1(start from first entry), store in the array q1b.
c. Reshape q1 to (5,1), store in the array q1c.
d. Reshape q1 to (1,5), store in the array q1d.
e. Flip the values of q1 so they are in the reverse order, store in the array qle.
*In Jupyter Lab!*
 Perform the operations listed below on the NumPy array q1= np.array([2,3,5,7,9]).

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!