bug in python/numarray

Xiangyi mxywp at 126.com
Tue Aug 2 19:21:37 EDT 2005


Robert and Terry-

Thank you so much for helping me on this!

Yes, it's a problem due to an old version of numarray. I didn't realize that 
my windows has a much newer version than the debian machine.

Best,
Xiangyi
----- Original Message ----- 
From: "Robert Kern" <rkern at ucsd.edu>
To: <python-list at python.org>
Sent: Tuesday, August 02, 2005 1:03 PM
Subject: Re: bug in python/numarray


> meng at are.berkeley.edu wrote:
>> Hi, there,
>>
>> I got different results by running the same lines of code on windows and
>> debian. Here is the code:
>>
>> a = kroneckerproduct(ones((4195,1)), identity(12))
>> print a.mean()
>>
>> This works perfectly well in windows but it gave the following error 
>> while
>> running it in debian:
>> Traceback (most recent call last):
>>    File "<stdin>", line 1, in ?
>>    File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line
>> 1137, in mean
>>      return self.sum()/(self.nelements()*1.0)
>>    File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line
>> 1133, in sum
>>      return ufunc.add.reduce(ufunc.add.areduce(self, type=type).flat,
>> type=type)
>> IndexError: too many indices.
>>
>> But if I reduce the number 4195 to 419, it works. Is it a bug in Python 
>> or
>> Numarray? Can someone help me figure it out? BTW, the python version is 
>> 2.4.1
>
> It's almost certainly numarray. I don't get an error on OS X with the
> latest CVS of numarray. Please try the latest CVS on your platforms, and
> if you still get this error, then post it to the numarray mailing list.
> Thanks!
>
> http://lists.sourceforge.net/lists/listinfo/numpy-discussion
>
> -- 
> Robert Kern
> rkern at ucsd.edu
>
> "In the fields of hell where the grass grows high
>  Are the graves of dreams allowed to die."
>   -- Richard Harter
>
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 





More information about the Python-list mailing list