下列选项中不能创建Numpy数组的选项是( )
A: a = numpy.array([1,2,3])
B: a = numpy.array([1,[1,2,3],3])
C: a = numpy.array([[1,2,3],[4,5,6]])
D: a = numpy.array([[‘xiao’,’qian’],[‘xiao’,’feng’]])
A: a = numpy.array([1,2,3])
B: a = numpy.array([1,[1,2,3],3])
C: a = numpy.array([[1,2,3],[4,5,6]])
D: a = numpy.array([[‘xiao’,’qian’],[‘xiao’,’feng’]])
举一反三
- 正确的定义numpy的二维数组的方法是:__________。 A: numpy.array([[1,2,3],[4,5,6],[7,8,9],[10,11,12],[13,14,15]]) B: numpy.array([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]).reshape(5,3) C: numpy.arange(15).reshape(5,3) D: A、B
- a是numpy数组,值为[1,2,3];b是numpy数组[[1,2,3],[4,5,6],[7,8,9]],a*b的运行结果是(
- 阅读以下代码,执行结果正确的是()。[img=533x67]17e0b96ef999aa5.png[/img] A: Array([0]=>;2[1]=>;4[2]=>;6) B: Array([0]=>;1[1]=>;2[2]=>;3) C: Array([0]=>;2[1]=>;6) D: Array([0]=>;1[1]=>;3)
- 存在多维数组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]])
- 下面二维数组定义不正确的是( ) A: $a = [[1,2,3],[4,5,6]]; B: $a['a'] = [1,2,3]; $a['b'] = [4,5,6]; C: $a = array( array(1,2,3), array(4,5,6,)); D: $a = array((1,2),array(1,2));