给定多维数组arr:arr =[[1 2 3] [4 5 6] [7 8 9]],可以得到[[5 6] [8 9]]的操作是
A: arr[1:2,1:2]
B: arr[1:3,1:3]
C: arr[1:,1:]
D: arr[:,:]
A: arr[1:2,1:2]
B: arr[1:3,1:3]
C: arr[1:,1:]
D: arr[:,:]
举一反三
- 存在多维数组arr,arr =np.array([[1 2 3] [4 5 6] [7 8 9]])数组arr.T的输出为 A: array([[1, 4, 7], [2, 5, 8], [3, 6, 9]]) B: array([[1, 2, 3], [4, 5, 8], [7, 6, 9]]) C: array([[1, 4, 7], [2, 5, 6], [3, 8, 9]]) D: array([[9, 4, 7], [2, 5, 8], [3, 6, 1]])
- 给定多维数组arr,arr = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]则np.mean(arr,axis=0)输出为 A: array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) B: array([4., 5., 6.]) C: array([2., 5., 8.]) D: array([1., 5., 8.])
- 创建数组arr=[ [0 1 2 3] [4 5 6 7] [8 9 10 11]],则arr*3=___________。
- A=[1,2,3;4:6;7:9]; C=[A;[10,11,12]], D=C(1:3,[2 3]) E=C(2,[1 2]) E=(__________________)
- 如果 frame = [[1,2,3],[4,5,6],[7,8,9]],则rgb = frame[::-1]的值是: A: [[7, 8, 9]] B: [[1,2,3],[4,5,6],[7,8,9]] C: [[7, 8, 9], [4, 5, 6], [1, 2, 3]] D: [[1, 2, 3], [4, 5, 6]]