-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
numpy.conjugate and numpy.ndarray.conjugate behave inconsistently #4730
Copy link
Copy link
Closed
Description
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)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels