[Numpy-discussion] ufunc broadcast for object arrays

Travis Oliphant oliphant at ee.byu.edu
Thu Mar 30 19:55:03 CST 2006


Simon Burton wrote:

>>>>a=numpy.array(list('foabcdeef'),dtype=numpy.dtype("O"))
>>>>numpy.equal(a,'f')
>>>>        
>>>>
A couple of things:

1)  dtype=numpy.dtype("O")  is equivalent to dtype="O"

2)  Because you have an object array this should work.   You can work 
around the bug using
numpy.equal(a,array('f','O'))

-Travis





More information about the Numpy-discussion mailing list