Oops, another one where I replied off-list.<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Luke Paireepinart</b> <<a href="mailto:rabidpoobear@gmail.com">rabidpoobear@gmail.com
</a>><br>Date: Dec 26, 2006 12:46 AM<br>Subject: Re: [Tutor] about array<br>To: "linda. s" <<a href="mailto:samrobertsmith@gmail.com">samrobertsmith@gmail.com</a>><br><br></span><br><br>
<div><span class="q"><span class="gmail_quote">On 12/26/06, <b class="gmail_sendername">linda.s</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:samrobertsmith@gmail.com" target="_blank">samrobertsmith@gmail.com
</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">When I read the following code, I found it was very hard for me to<br>understand the meaning of a[1:3,:-1:2] for a[i,j] for i=1,2 and
<br>j=0,2,4; the same as a[::3,2:-1:2]</blockquote>
<div> </div></span>
<div>What is your question here?</div>
<div>you want an explanation of list slicing?</div>
<div>what does this mean? </div><span class="q">
<div>"</div>
<div>the meaning of a[1:3,:-1:2] for a[i,j] for i=1,2 and<br>j=0,2,4; the same as a[::3,2:-1:2]</div>
<div>"</div>
<div> </div></span>
<div>Do you mean your lack of understanding is the same in both cases or the slices are the same?</div>
<div>they aren't.</div>
<div>The weird way you worded this was really confusing, and I'm not sure what you meant.</div><span class="q"><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">>>> a<br>array([[ 0., 1., 2., 3., 4., 5.],<br>[ 6., 7., 8., 9., 10., 11.],<br>[ 12., 13., 14., 15., 16., 17.],
<br>[ 18., 19., 20., 21., 22., 23.],<br>[ 24., 25., 26., 27., 28., 29.]])</blockquote></span>
<div>Where'd this array function come from?</div>
<div>Are you using Numeric or Numpy or something?</div>
<div>in that case, these should have good documentation on how list slicing works in them.</div>
<div>It should be the same as in regular Python, but I won't assume that's the case,</div>
<div>because I have no experience with any of these libraries.</div>
<div> </div>
<div>or are you using the built-in Python array function?</div>
<div> </div>
<div>It probably doesn't matter, but the more information, the better.</div>
<div> </div>
<div>Again, I don't have access to a python interpreter, so I can't give you any specific help.</div>
<div>But you should read an article on Python list slicing.</div>
<div>I'd have to say GIYF here.</div>
<div>If you find an article and when you're reading through it you come to something that doesn't make sense, and ask about that specifically, it will be easier for us to answer.</div>
<div> </div>
<div> </div>
<div>HTH,</div>
<div>-Luke</div></div><br>