[Numpy-discussion] BUG: numpy.put raises TypeError.

Pearu Peterson pearu at scipy.org
Fri Feb 10 03:10:03 CST 2006


Hi,

There seems to be a bug in numpy.put function (i.e. array.put method). 
Consider the following example:

a = array([0, 0, 0, 0, 0])

a.put([1.1],[2])   # works as documented

a.put(array([1.1]),[2])   # raises the following exception:
   TypeError: array cannot be safely cast to required type

The bug seems to boil down to calling PyArray_FromArray function but I 
got a bit lost on debugging this issue..

Pearu




More information about the Numpy-discussion mailing list