[Numeric] why is Float32 incorrect for ufuncs?

Curzio Basso curzio.basso at unibas.ch
Thu Mar 4 11:22:16 EST 2004


Hello everyone,

I am a beginner with Numerical Python, and there is a thing I do not 
understand in the behaviour of the ufuncs. Maybe someone can enlighten me.

Why is the following not working?

 >>> import Numeric
 >>> a=Numeric.ones((2,2),Numeric.Float32)
 >>> a
array([[ 1.,  1.],
        [ 1.,  1.]],'f')
 >>> a/=2
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: return array has incorrect type

If I use Numeric.Float64 as typecode everything works fine, but I do not 
understand why is this needed.

thanks for your help. curzio.




More information about the Python-list mailing list