如下代码的输出结果是( )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:]))
- 下面程序段的执行结果为_______。 import numpy as np t = np.arange(120).reshape(3,4,5,2) t0=np.sum(t,axis=1) print(t0.shape)
- 如下代码的输出是( )import numpy as npa = np.arange(6).reshape(3, 2)b = a.sum(axis=0)c = b.sum(axis=0)
- 假设已执行语句import numpy as np和c = np.arange(25).reshape(5,5),那么表达式c[[2,4], 3:].sum()的值为__。
- import numpy as np np.arange(0, 1, 0.1)的结果是?