Re: Slice lists and extended slicing

2011-01-26 Thread Terry Reedy
ts don't accept them. I don't know of any built-in data type that takes slice lists but numpy matrices will. a = numpy.matrix([[1,2,3],[4,5,6],[7,8,9]]) matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) a[0:2,1:3] matrix([[2, 3], [5, 6]]) Which is to say, slic

Re: Slice lists and extended slicing

2011-01-26 Thread Emile van Sebille
On 1/26/2011 9:20 AM Gerald Britton said... I'm looking at extended slicing and wondering when and how to use slice lists: I think the use of the term slice_list below is simply as the content between the encompassing brackets, eg in mylist[1:2:3] slice_list refers to 1:2:3. So, you

Re: Slice lists and extended slicing

2011-01-26 Thread Chris Rebert
On Wed, Jan 26, 2011 at 9:20 AM, Gerald Britton wrote: > I'm looking at extended slicing and wondering when and how to use slice lists: > > slicing          ::=  simple_slicing | extended_slicing > simple_slicing   ::=  primary "[" short_slice "]" > exte

Re: Slice lists and extended slicing

2011-01-26 Thread Robert Kern
On 1/26/11 11:20 AM, Gerald Britton wrote: I'm looking at extended slicing and wondering when and how to use slice lists: slicing ::= simple_slicing | extended_slicing simple_slicing ::= primary "[" short_slice "]" extended_slicing ::= primary &quo

Re: Slice lists and extended slicing

2011-01-26 Thread Benjamin Kaplan
On Wed, Jan 26, 2011 at 12:20 PM, Gerald Britton wrote: > I'm looking at extended slicing and wondering when and how to use slice lists: > > slicing          ::=  simple_slicing | extended_slicing > simple_slicing   ::=  primary "[" short_slice "]" > exte

Slice lists and extended slicing

2011-01-26 Thread Gerald Britton
I'm looking at extended slicing and wondering when and how to use slice lists: slicing ::= simple_slicing | extended_slicing simple_slicing ::= primary "[" short_slice "]" extended_slicing ::= primary "[" slice_list "]" sli

Re: slice lists

2005-09-19 Thread jbperez808
> Lists are one-dimensional. They can only take one slice, not two. Ah ok, I thought l[3:4,5:8] would return [3,5,6,7] -- http://mail.python.org/mailman/listinfo/python-list

Re: slice lists

2005-09-19 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Reading: > > http://docs.python.org/ref/slicings.html > > it would seem to indicate that the ff will work: > > L=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] > > however, you get: > > >>> l[3:4:,5:8:] > Traceback (most recent call last): > File "", line 1, in ? >

slice lists

2005-09-19 Thread jbperez808
Reading: http://docs.python.org/ref/slicings.html it would seem to indicate that the ff will work: L=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] however, you get: >>> l[3:4:,5:8:] Traceback (most recent call last): File "", line 1, in ? l[3:4:,5:8:] TypeError: list indices must be integ