[Numpy-discussion] problem w 32bit binomial?

James Bergstra bergstrj@iro.umontreal...
Thu Feb 25 16:59:20 CST 2010


In case this hasn't been solved in more recent numpy...

I've tried the following lines on two installations of numpy 1.3 with python 2.6

 numpy.random.binomial(n=numpy.asarray([2,3,4], dtype='int64'),
p=numpy.asarray([.1, .2, .3], dtype='float64'))

A 64bit computer gives an output of array length 3.
A 32bit computer gives an error:

    TypeError: array cannot be safely cast to required type

If I change the int64 cast to an int32 cast then it works on both machines.

Thanks,

James
--
http://www-etud.iro.umontreal.ca/~bergstrj



-- 
http://www-etud.iro.umontreal.ca/~bergstrj


More information about the NumPy-Discussion mailing list