I have an array like below:
poles = numpy.array([[-1+1j], [-1-1j], [-2+3j], [-2-3j]])
Its shape is (4,1).
When I use the numpy.diag like below:
LA = numpy.diag(poles)
The output is [-1.+1.j] while I'm expecting to see a diagonal matrix.
Can someone explain what is going on and what should be done to see a diagonal matrix?
I also tried to change the shape to (1,4) but the result didn't change.
np.diagwill take the diagonal values of your array, which there is only one item since one of your axes is only length 1.