May 30, 2006
10:43 a.m.
On May 30, 2006, at 11:28 AM, Rick Muller wrote:
Is it possible to create arrays that run from, say -5:5, rather than 0:11? Analogous to the Fortran "allocate(A(-5:5))" command? I'm translating a F90 code to Python, and it would be easier to do this than to use a python dictionary.
On Tue, 30 May 2006, Rob Hetland wrote:
I believe Rick is talking about negative indices (possible in FORTRAN), in which case the answer is no.
I see. Perhaps this is still relevant? (Or perhaps not.)
y=N.arange(11) x=range(-5,6) y[x] array([ 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5])
hth, Alan Isaac