Original ticket http://projects.scipy.org/numpy/ticket/1142 on 2009-06-19 by @inducer, assigned to unknown.
numpy could really do a better job here by propagating the .real to the elements of the object array:
Python 2.5.4 (r254:67916, Feb 18 2009, 03:00:47)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as n
>>> n.__version__
'1.3.0'
>>> a = n.array(5+7j)
>>> b = n.array([a], dtype=object)
>>> b.real
array([(5+7j)], dtype=object)
>>> n.real(b)
array([(5+7j)], dtype=object)
Summary by @seberg:
Object arrays could call .real on all objects, but that would not return a view as typically promised by arr.real. It seems that moving forward here may require a new function that returns a copy?
Original ticket http://projects.scipy.org/numpy/ticket/1142 on 2009-06-19 by @inducer, assigned to unknown.
numpy could really do a better job here by propagating the .real to the elements of the object array:
Summary by @seberg:
Object arrays could call
.realon all objects, but that would not return a view as typically promised byarr.real. It seems that moving forward here may require a new function that returns a copy?