为什么是array1[:][1] != array1[:,1]
?
例如:
array1 = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
array1[1] ## Output: array([4,5,6]) as expected
array1[:,1] ## Output: array([2, 5, 8]) as expected
array1[:][1] ## Output: array([4,5,6]) which isn't what I expected!
使用双括号引用时,array1[:]
组件是否首先执行返回完整2D
数组?因此array1[:][1] == array1[1]
?