The following code indicates there is a problem adding a numpy scalar type to a Numeric array. Is this expected behavior or is there a bug somewhere? This bit me in the context of updating some of my code to numpy, while part of it still uses Numeric. import Numeric import numpy print 'Numeric.__version__',Numeric.__version__ print 'numpy.__version__',numpy.__version__ a = Numeric.zeros( (10,2), Numeric.Float ) b = numpy.float64(23.39) a[0,1] = a[0,1] + b assert a[0,1]==b
Andrew Straw wrote:
The following code indicates there is a problem adding a numpy scalar type to a Numeric array. Is this expected behavior or is there a bug somewhere?
There was a bug in the __array_struct__ attribute of array flags wherein the NOTSWAPPED flag was not being set as it should be. This is fixed in SVN. -Travis
participants (2)
-
Andrew Straw -
Travis Oliphant