Converting bool to float

Keith Goodman kwgoodman at
Wed Nov 1 19:50:15 CST 2006

On 11/1/06, Travis Oliphant <oliphant at> wrote:
> It looks like 1.0-x is doing the right thing.
> The problem is 1.0*x for matrices is going to float64.  For arrays it
> returns float32 just like the 1.0-x
> This can't be changed at this point until 1.1
> We will fix the bug in 1.0*x producing float64, however.  I'm still not
> sure what's causing it, though.

I think it would be great if float64 was the default in numpy. That
way most people wouldn't have to worry about dtypes when crunching
numbers. And then numpy could apply for a trademark on 'it just

Having to worry about dtypes makes users (me) nervous.

I imagine a change like this would not be an overnight change, more of
a long-term goal.

This one, from a previous thread, also makes me nervous:

>> sum(M.ones((300,1)) == 1)
matrix([[44]], dtype=int8)

But float64 might not make sense here.

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo

More information about the Numpy-discussion mailing list