Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andyjost opened this issue May 21, 2014 · 0 comments · Fixed by #4887
Closed

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

andyjost opened this issue May 21, 2014 · 0 comments · Fixed by #4887

Comments

@andyjost
Copy link

andyjost commented May 21, 2014

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant