[Numpy-discussion] float32 is not a float ?

Stéfan van der Walt stefan@sun.ac...
Thu Apr 10 14:17:01 CDT 2008


Hi Charles

On 10/04/2008, Charles Doutriaux <doutriaux1@llnl.gov> wrote:
>   >>> a=numpy.ones(5,dtype=numpy.float32)
>   >>> isinstance(a[0],float)

I'd recommend using issubdtype instead:

np.issubdtype(a[0],float)

Regards
Stéfan


More information about the Numpy-discussion mailing list