Skip to content

Inconsistent behavior of float32, float64 (Trac #764) #1362

numpy-gitbot opened this Issue Oct 19, 2012 · 6 comments

1 participant


Original ticket on 2008-04-29 by @charris, assigned to unknown.

In [1]: float32(array([[1]]))
Out[1]: array([[ 1.]], dtype=float32)

In [2]: float64(array([[1]]))
Out[2]: 1.0

In [3]: int64(array([[1]]))
Out[3]: array([[1]], dtype=int64)

In [4]: int32(array([[1]]))
Out[4]: 1

But also

In [5]: float64([[1]])
Out[5]: array([[ 1.]])

In [6]: int32([[1]])
Out[6]: array([[1]])

@charris wrote on 2008-05-08

I'm leaving this to Travis, as the problem seems to be different behavior for those numpy types that are also python types when the input is an array. I don't know which routines are relevant to the error, but I suspect Travis does, and the fix should be easy.


Milestone changed to 1.2.0 by @charris on 2008-05-20


@cournape wrote on 2009-03-02

I think that it is actually not fixable ? I remember we had some discussion about this point for formatting problems, and that we can't control everything to make np.double (which inherit from python type) and np.float32 completely the "same" for some features.

Maybe someone more knowledgeable could confirm ?


Milestone changed to 1.4.0 by @cournape on 2009-03-11


@mwiebe wrote on 2011-03-23

I think most of these cases should be raising errors.


Milestone changed to Unscheduled by @mwiebe on 2011-03-23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.