getting slices out of an array

Cool. :smiley: This is exactly what I'm searching for. But

    > this is not really a Python syntax... The coma in the
    > square brackets is not standard for lists. Maybe this
    > come from the array type ?

Yes, this is Numeric/numarray slicing, not list slicing. When you get
some time, you should read the pdf Numeric or numarray documentation.
It's comprehensive and very good.

Numarray also offers enhanced indexing ( Numeric does not yet) which
is a convenience you probably expect coming from matlab. Eg, you can
index an array with a sequence of integers (you must be careful that
the sequence is not a tuple however; lists or arrays of ints are ok)

    >>> import numarray as na
    >>> a = na.arange(0.0, 2.0, 0.1)
    >>> ind = [2,5,7]
    >>> a[ind]
    array([ 0.2, 0.5, 0.7])

JDH

Hello all,

Yes, this is Numeric/numarray slicing, not list slicing. When you get
some time, you should read the pdf Numeric or numarray documentation.
It's comprehensive and very good.

Thanks for all the answers. I'm now looking at the numarray/numeric
documentation as suggested.

Good day, and thanks again.

        Olivier

···

--
   . __ . ___ __. | Olivier Bornet Olivier.Bornet@...567...
  / / ` / / / / / | IDIAP Olivier Bornet @ Idiap
/ / / / /--/ /--' | CP 592 Olivier Bornet PGP key
/ /__.' / / / / | CH-1920 Martigny PGP-key: 0xC53D9218