>>> x = np.array([[1, 2, 3], [4, 5, 6]], np.int32)
>>> x.dtype
dtype('int32')
>>> x = np.array([[1, 2, 3], [4, 5, 6]], np.int32)
>>> x[1, 2]
6
>>> x[1][2]
6
>>> x = np.array([[1, 2, 3], [4, 5, 6]], np.int32)
>>> y = x[1, :]
>>> y
array([4, 5, 6], dtype=int32)
>>> x = np.array([[1, 4, 2], [6, 1, 8]], dtype=np.int32)
>>> y = np.all(x, keepdims=True)
>>> y.ndim
2
>>> x.ndim
2
>>> y.shape
(1, 1)
>>> x.shape
(2, 3)
值得注意的是是否使用keepdims不会影响内容, 只是会影响结构.