Skip to content

numpy.conjugate and numpy.ndarray.conjugate behave inconsistently #4730

Closed
andyjost opened this Issue May 21, 2014 · 0 comments

1 participant

@andyjost

If x is an ndarray of objects that define a method "conjugate", then numpy.conjugate(x) takes the conjugate of each element, but x.conjugate() does nothing.

numpy.version.git_revision
'697316a867a32e9f72778a29226c9febbf867ee8'
numpy.version.version
'1.7.1'
numpy.version.release
True

class Object(object):
... def conjugate(self, args, *kwds):
... print 'Calling conjugate'
... return self
...
o = Object()
o.conjugate()
Calling conjugate
<main.Object object at 0x18db1c90>
oo = numpy.array([o,o])
numpy.conjugate(oo)
Calling conjugate
Calling conjugate
array([<main.Object object at 0x18db1c90>,
<main.Object object at 0x18db1c90>], dtype=object)
oo.conjugate()
array([<main.Object object at 0x18db1c90>,
<main.Object object at 0x18db1c90>], dtype=object)

@ewmoore ewmoore added a commit to ewmoore/numpy that referenced this issue Jul 18, 2014
@ewmoore ewmoore BUG: object array np.conjugate, ndarray.conjugate inconsistent
fixes gh-4730
5bf4834
@ewmoore ewmoore added a commit to ewmoore/numpy that referenced this issue Jul 23, 2014
@ewmoore ewmoore BUG: object array np.conjugate, ndarray.conjugate inconsistent
fixes gh-4730
5941fc9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.