📜  Python 中的省略号作为索引 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:38.851000             🧑  作者: Mango

代码示例1
#The ellipsis is used in numpy to slice higher-dimensional data structures.
#It's designed to mean at this point, insert as many full slices (:) 
#to extend the multi-dimensional slice to all dimensions. so e.g.
a = np.zeros((3,3,3))
a[::, 0]
#gives the same as
a[..., 0]