执行如下代码arr1=[[1,3],[2,4]]arr2=[[2,1],[4,1]]np.multiply(arr1,arr2)则输出结果为
A: array([[14, 4], [20, 6]])
B: array([[2, 3], [8, 4]])
C: array([[0.5, 3. ], [0.5, 4. ]])
D: array([[ 4, 10], [ 6, 16]])
A: array([[14, 4], [20, 6]])
B: array([[2, 3], [8, 4]])
C: array([[0.5, 3. ], [0.5, 4. ]])
D: array([[ 4, 10], [ 6, 16]])
举一反三
- 给定多维数组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,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=[ [0 1 2 3] [4 5 6 7] [8 9 10 11]],则arr*3=___________。
- 给定多维数组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[:,:]
- 以下代码创建ndarray数组,请补全代码。import numpy as np data = [5,7,9,20] arr = np.____(data) arr输出结果为:array([5,7,9,20])