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
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
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
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
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
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
> 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
[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 ?
>
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