Search code examples
pythonnumpyattributeerrorcomplex-numbers

Problem using numpy to obtain the complex conjugate of a matrix


I have the following code:

import numpy as np
A=np.array([[2, 2-9j, -5j], [4-1j, 0, 9+6j], [4j, 6+7j, 6]])
print(A)
print(A.getH())

It doesn't work. I have checked different webs and followed this webpage (geeksforgeeks), and this other(official numpy documentation) but I still get an error and I don't know where. Can someone please help me?

The error is 'numpy.ndarray' object has no attribute 'getH'


Solution

  • That's correct, a numpy array doesn't have a method getH. Your second link actually is the official documentation, and it shows that the method is not called getH. Read the documentation closely!