<br><br><div><span class="gmail_quote">On 2/24/06, <b class="gmail_sendername">Travis Oliphant</b> <<a href="mailto:oliphant@ee.byu.edu">oliphant@ee.byu.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Sasha wrote:<br><br>>Numpy allows multiple ellipses in indexing expressions, but I am not<br>>sure if that is useful.  AFAIK, ellipsis stands for "as many :'s as<br>>needed", but if there is more than one, how do I know how many :'s
<br>>each of them represents:<br>><br>><br>It should be that the first ellipsis is interpreted as an ellipsis.  Any<br>others are silently converted to ':' characters.<br><br>><br>><br>>>>>x = arange(8)
<br>>>>>x.shape=(2,2,2)<br>>>>>x[0,...,0,...]<br>>>>><br>>>>><br>>array([0, 1])<br>><br>><br>This is equivalent to<br><br>x[0,...,0,:]<br><br>which is  equivalent to
<br><br>x[0,0,:]  (because the ellipsis is interpreted as nothing).<br><br>>>>>x[0,0,:]<br>>>>><br>>>>><br>>array([0, 1])<br>><br>><br>>>>>x[0,:,0]<br>>>>>
<br>>>>><br>>array([0, 2])<br>><br>>In the example above, the first ellipsis represents no :'s and the<br>>last one represents one.  Is that the current rule that the last<br>>ellipsis represents all the needed :'s?   What is the possible use for
<br>>that?<br>><br>><br>><br>The rule is that only the first ellipsis (from left to right) is used<br>and any others are just another spelling of ':'.<br><br>This is the rule that Numeric implemented and so it's what we've kept.
<br>I have no idea what the use might be, but I saw changing the rule as<br>gratuitous breakage.</blockquote><div><br>This might be a good time to change this behavior, since I've yet to find a good reason for keeping it.  Maybe we can depricate it until version 
1.0.<br><br> -- Paul<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thus, only one ellipsis is actually treated like an ellipse.  Everything
<br>else is treated as ':'<br></blockquote></div><br>