[Numpy-discussion] Possible bug in scalar * array

Todd Miller jmiller at stsci.edu
Sun Oct 19 07:20:02 CDT 2003


I confirmed this and logged it on Source Forge as numpy-Numarray
Bugs-826311 [Numpy-discussion] Possible bug in scalar * array.

I don't have a fix yet.

Todd

On Sat, 2003-10-18 at 18:18, Edward C. Jones wrote:
> #! /usr/bin/env python
> 
> # Python 2.3.2, numarray 0.7
> import numarray
> 
> def fun1(code, scale):
>      arr1 = numarray.ones((4,4), code)
>      arr2 = scale * arr1
>      arr3 = numarray.ones((4,4), code)
>      # Bug appears at second multiply.
>      arr4 = scale * arr3
> 
> def fun2(code, scale):
>      arr = numarray.ones((4,4), code)
>      arr2 = scale * arr
>      # Bug appears at second multiply.
>      arr3 = scale * arr
> 
> # These calls fail when "scale" is too big for "code":
> 
> #   File 
> "/usr/local/lib/python2.3/site-packages/numarray/numarraycore.py", line 
> 653, in __rmul__
> #    def __rmul__(self, operand): return ufunc.multiply(operand, self)
> # ValueError: invalid shape tuple
> 
> #fun2('Int16', 100000)
> fun2('UInt8' , -1)
> 
> 
> 
> -------------------------------------------------------
> This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
> The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
> Linux in the Boardroom; in the Front Office; & in the Server Room 
> http://www.enterpriselinuxforum.com
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
-- 
Todd Miller <jmiller at stsci.edu>





More information about the Numpy-discussion mailing list