[Numpy-discussion] dtype=float32 not recognised.

Francesc Altet faltet at carabos.com
Wed Jan 25 00:26:03 CST 2006


A Dimecres 25 Gener 2006 01:56, Sasha va escriure:
> You did not import float32.
>
> Your options:
> >>> from numpy import *
> >>> zeros(5, dtype=float32)
>
> array([ 0.,  0.,  0.,  0.,  0.], dtype=float32)
>
> or
>
> >>> import numpy
> >>> numpy.zeros(5, dtype=numpy.float32)
>
> array([ 0.,  0.,  0.,  0.,  0.], dtype=float32)
>
> or
>
> >>> import numpy
> >>> numpy.zeros(5, dtype=float)
>
> array([ 0.,  0.,  0.,  0.,  0.])

Another one:

>>> import numpy
>>> numpy.zeros(5, dtype="float32")
array([ 0.,  0.,  0.,  0.,  0.], dtype=float32)

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





More information about the Numpy-discussion mailing list