[Numpy-discussion] weird indexing

Sebastian Haase haase@msg.ucsf....
Fri Jan 4 04:31:31 CST 2008


On Jan 4, 2008 1:16 AM, Mathew Yeates <myeates@jpl.nasa.gov> wrote:
> Hi
> Okay, here's a weird one. In Fortran you can specify the upper/lower
> bounds of an array
> e.g. REAL A(3:7)
>
> What would be the best way to translate this to a Numpy array? I would
> like to do something like
> A=numpy.zeros(shape=(5,))
> and have the expression A[3] actually return A[0].
>
> Or something. Any thoughts?
>
As far as I know, numpy only supports the lower boundary to be 0  --
just like C.
(I didn't even know that Fortran supported this ;-)  )

-Sebastian Haase


More information about the Numpy-discussion mailing list