What is the value of B after the following Python commands? A = np.array([[1,2,3],[4,5,6],[7,8,9]]) B = np.hstack((A[:,(0,1)], A[:, 1:2]))单项选择题

A
a. [[1, 2, 3], [4, 5, 6], [1, 2, 3]]
B
b. [2, 2]
C
c. [[1, 1, 2], [4, 4, 5], [7, 7, 8]]
D
d. [[1, 2, 2], [4, 5, 5], [7, 8, 8]]
E
e. [[1, 2, 1, 2], [4, 5, 4, 5], [7, 8, 7, 8]]
登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
类似问题
What is the value of count after the following commands? c = np.array([[6, 1, 4], [2, 1, 5], [3, 7, 1]]) n = len(c) count = 0 for i in range(n): for j in range(n): if i==j and c[i,j]==1: count += 1
What is the value of j after three iterations of the following loop? j = np.linspace(0,20,5); for m in range(len(j)): j[m] = j[m]*2;
What is the value of z after the following commands? import numpy as np x = 1 y = 1 z = np.zeros(1) while y < 4: z = np.append(z, 0) z[x] = 2 * y x = x + 1 y = y + 2
A file which contains only one row of data is imported using np.genfromtxt() and is assigned to X. Which of the following is true?
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!