You probably don't need to do the conversion. If you perform some calculations using your bool array and another floating point array, the conversion will be performed during the operation:
import numpy as np
y = np.array([False, True, True, False], dtype=bool)
x = np.array([2.5, 3.14, 2.7, 8.9], dtype=float)
z = x*y
print z
[ 0. 3.14 2.7 0. ]
source
share