[Numpy-discussion] Default values in scalar constructors

Francesc Altet faltet at carabos.com
Tue Sep 26 12:42:46 EDT 2006


Hi,

Is there any reason why the next works for some types:

In [26]: numpy.int32()
Out[26]: 0

In [27]: numpy.float64()
Out[27]: 0.0

but don't for the next others?

In [28]: numpy.int16()
---------------------------------------------------------------------------
<type 'exceptions.TypeError'>             Traceback (most recent call last)

/home/faltet/python.nobackup/numpy/<ipython console> in <module>()

<type 'exceptions.TypeError'>: function takes exactly 1 argument (0 given)

In [29]: numpy.float32()
---------------------------------------------------------------------------
<type 'exceptions.TypeError'>             Traceback (most recent call last)

/home/faltet/python.nobackup/numpy/<ipython console> in <module>()

<type 'exceptions.TypeError'>: function takes exactly 1 argument (0 given)

-- 
>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data
 "-"




More information about the NumPy-Discussion mailing list