举一反三
- a=array([[0,1,2,3], [4,5,6,7], [8,9,10,11], [12,13,14,15]]) b=array([[16,17,18,19], [20,21,22,23], [24,25,26,27], [28,29,30,31]]) 通过语句np.concatenate((a,b),axis=1)可以产生 array([[0,1,2,3,16,17,18,19], [4,5,6,7,20,21,22,23], [8,9,10,11,24,25,26,27], [12,13,14,15,28,29,30,31]])
- ls=[ [1,2,3,4],['a','b','c','d'],['列','表'] ][br][/br] 请写出结果: ls[0] (1) ls[0][0] (2) ls[1][0:2] (3)
- 数组x定义:String x[ ][ ]=new int[3][2]; x[0 ][0 ]=”abc”, x[0 ][1]=”12345”;<br/>则 x.length 的值为______ ,x[0][1].leng()的值为______ 。
- 创建数组arr=[ [0 1 2 3] [4 5 6 7] [8 9 10 11]],则arr*3=___________。
- 以下代码的显示结果是什么? data=[[[1,2],[3,4]],[[5,6],[7,8]]] print(data[1][0][0]) A: 1 B: 2 C: 4 D: 5 E: 6
内容
- 0
float f[][][] = new float[3][][]; float f0 = 1.0f; float[][] farray = new float[1][1]; What is valid?() A: f[0] = f0; B: f[0] = farray; C: f[0] = farray[0]; D: f[0] = farray[0][0];
- 1
若有语句:b = np.array([[1,2,3],[4,5,6]]),则表达式b.itemsize的值为( ) A: 1 B: 2 C: 4 D: 8
- 2
下列 Python语句的程序运行结果为list1=[1,2,3];list2=[3,4,5];dict1={'1':list1,'2':list2};dict2=dict1.copy()dict1['1'][0]=15; print(dict1['1'][0]+dict2['1'][0])
- 3
inta[ 2 ][ 3 ]={{1,2},{1}}; a[0][1]的值是 A: 2 B: 0
- 4
若有语句:a= np.array([[1,2,3],[4,5,6]],dtype = np.int64),则a.itemsize的值为______