Hi all,

I'd like to set the data type for what numpy.where creates. For example:

import numpy as N

N.where(a >= 5, 5, 0)

creates an integer array, which makes sense.

N.where(a >= 5, 5.0, 0)

creates a float64 array, which also makes sense, but I'd like a float32 
array, so I tried:

N.where(a >= 5, array(5.0, dtype=N.float32), 0)

but I got a float64 array again.

How can I get a float32 array? where doesn't take a dtype argument -- 
maybe it should?

numpy version 1.0

thanks,
-Chris
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to