30 Apr
2006
30 Apr
'06
4:50 p.m.
Here is an issue I am having with scalarmath:
import numpy numpy.__version__ '0.9.7.2462' import numpy.core.scalarmath a = numpy.array([1], 'h') 1*a array([1], dtype=int16) 1*a[0] Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: unsupported operand type(s) for *: 'int' and 'int16scalar'
This happens because PyArray_CanCastSafely returns false for casting from int to short. alter_scalars(int) fixes this, but I have lots of non-numpy code that I don't want to behave differently. Ted On Apr 28, 2006, at 02:12, Travis Oliphant wrote:
The scalar math module is complete and ready to be tested. It should speed up code that relies heavily on scalar arithmetic by by- passing the ufunc machinery.