[Tutor] question on numarray across platforms

Xiangyi Meng wpmxy at sbcglobal.net
Mon Aug 1 17:46:41 CEST 2005

Hi there,

I ran across this error when running a few lines of 
code in debian python, but this runs perfectly in
windows python. Basically I created a dummy matrix
called "gamma" (using kroneckerproduct in numarray)
and printed out its mean.  Here is the code:
gamma = kroneckerproduct(ones((N, 1)),identity(T))
print gamma.mean()

and Here is the error message:
Traceback (most recent call last):
  File "vul_prov.py", line 149, in ?
    VLs = mv_prov(hhc, idyrisk, provid, 1)
line 605, in mv_prov
    print gamma.mean()
line 1137, in mean
    return self.sum()/(self.nelements()*1.0)
line 1133, in sum
    return ufunc.add.reduce(ufunc.add.areduce(self,
type=type).flat, type=type)
IndexError: too many indices.

Thank you for helping on this! Oh, btw, the version
for python in both platforms is 2.4.1


More information about the Tutor mailing list