문제

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,

도움이 되었습니까?

해결책

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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top