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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started