From: Sasha <nd...@ma...> - 2006-02-24 21:29:10
|
Numpy allows multiple ellipses in indexing expressions, but I am not sure if that is useful. AFAIK, ellipsis stands for "as many :'s as needed", but if there is more than one, how do I know how many :'s each of them represents: >>> x =3D arange(8) >>> x.shape=3D(2,2,2) >>> x[0,...,0,...] array([0, 1]) >>> x[0,0,:] array([0, 1]) >>> x[0,:,0] array([0, 2]) In the example above, the first ellipsis represents no :'s and the last one represents one. Is that the current rule that the last ellipsis represents all the needed :'s? What is the possible use for that? |