returning a list: IndexError

shama.bell at gmail.com shama.bell at gmail.com
Thu Mar 31 02:03:03 CEST 2005


Hello,

I am getting the following error when returning a list:

return tbl[c1,c2]

"IndexError: each subindex must be either a slice, an integer,
Ellipsis, or NewAxis"

What does it mean?

Here's the code snippet....

from Numeric import *

# Initialize the 32x16 global array to zeros
tbl = zeros((32, 16)

def getValue( value):
    data = test(value)
    c1 = data[0]
    c2 = data[1]
    print tbl[c1, c2]

def test( value):
    t1 = 0x0
    t2 = 0x1
    return tbl[t1, t2]

Thanks,
-SB




More information about the Python-list mailing list