It is very convenient in numpy to use the .T
attribute to get a transposed version of an ndarray
. However, there is no similar way to get the conjugate transpose. Numpy's matrix class has the .H
operator, but not ndarray. Because I like readable code, and because I'm too lazy to always write .conj().T
, I would like the .H
property to always be available to me. How can I add this feature? Is it possible to add it so that it is brainlessly available every time numpy is imported?
(A similar question could by asked about the .I
inverse operator.)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…