Question: 1. Create the following arrays using NumPy: a) A 1D array containing numbers from 1 to 10. b) A 2D array of shape (3,3) containing

1. Create the following arrays using NumPy:

a) A 1D array containing numbers from 1 to 10.

b) A 2D array of shape (3,3) containing numbers from 1 to 9.

c) A 3D array of shape (2,2,2) containing numbers from 1 to 8.

2. For a given array: arr = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])

a) Retrieve the value 6.

b) Retrieve the second row.

c) Retrieve the first two rows and the last two columns.

3. a. Given two 1D arrays: a = np.array([1,2,3]) and b = np.array([4,5,6]), join them.

b. Split the resulting array into three equal parts.

c. Create a 1D array with 10 random integers between 1 and 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!