Question

I have a problem with making complex conjugate of an element of an array in pypy. For example, running this code does not work:

from numpypy import *

a = array([1,2,3.4J],dtype=complex);

print a[2]

print a[2].conjugate()

This gives me a warning message as "unsupported operand type for conjugate: 'complex128'".

I tried this in numpy, which works without any problem.

Could anybody help me figure out what's wrong with this, and how I can fix this?

Best,

Was it helpful?

Solution

Moved as a bug report of PyPy: https://bugs.pypy.org/issue1543

As a temporary workaround, you can use complex(a[2].real, -a[2].imag).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top