有如下语句:import numpy as npA=np.arange(12)可生成数组[1,2,3,4,5,6,7,8,9,10,11,12]
举一反三
- 【单选题】myarray1=np.arange(15) myarray2=myarray1.reshape(5,3) print( myarray1) print(myarray2) 输出值是? A. [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15] [[ 0 1 2] [ 3 4 5] [ 6 7 8] [ 9 10 11] [12 13 14]] B. [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15] [[ 1 2 3] [ 4 5 6] [ 7 8 9] [10 11 12] [13 14 15]] C. [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14] [[ 0 1 2] [ 3 4 5] [ 6 7 8] [ 9 10 11] [12 13 14]] D. [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14] [[ 1 2 3] [ 4 5 6] [ 7 8 9] [10 11 12] [13 14 15]]
- 下面是图的拓扑排序的是?(多选)[img src="https://i1.chinesemooc.org/course/formula/201610/eb69927aaf8baae83211ee3fadf836e7.png"] A: 2 8 0 7 1 3 5 6 4 9 10 11 12 B: 2 8 7 0 6 9 11 12 10 1 3 5 4 C: 8 2 7 3 0 6 1 5 4 9 10 11 12 D: 8 2 7 0 6 9 10 11 12 1 3 5 4
- ndarray对象实例a,代码如下:import numpy as npa = np.array([[0, 1, 2, 3, 4], [9, 8, 7, 6, 5]])a.shape的执行结果是什么?
- 如下代码的输出结果是( )import numpy as npa = np.arange(12).reshape(3, 4)print(np.sum(a[1:, 2:]))
- 如下代码的输出结果是( )import numpy as npa = np.arange(12).reshape(3, 4)print(np.sum(a[[0, 2], 2:]))