Question: Construct the specified arrays by indexing A . For example, if asked for array ( [ 0 , 1 , 2 ] ) , a

Construct the specified arrays by indexing A. For example, if asked for array([0,1,2]), a correct answer would be A[0,:]. Each of the parts below may be performed in a single line.
[15]
0s
# run this block to initialize A
import numpy as np
A = np.arange(12).reshape(4,3)
A
output
array([[0,1,2],
[3,4,5],
[6,7,8],
[9,10,11]])
(A).
array([6,7,8])
Your solution here
[17]
0s
A[2,:]
output
array([6,7,8])
(B).
array([5,8])

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!