[Numpy-discussion] real and imag functions should produce errors for object arrays

Michael Gilbert michael.s.gilbert at gmail.com
Tue Sep 21 17:31:55 EDT 2010


Hi,

The following example demonstrates a rather unexpected result:

>>> import numpy
>>> x = numpy.array( complex( 1.0 , 1.0 ) , numpy.object )
>>> print x.real
(1+1j)
>>> print x.imag
0

Shouldn't real and imag return an error in such a situation?

Thanks,
Mike



More information about the NumPy-Discussion mailing list