📜  Python| numpy matrix.conj()

📅  最后修改于: 2022-05-13 01:55:41.617000             🧑  作者: Mango

Python| numpy matrix.conj()

借助Numpy matrix.conj()方法,我们能够找到具有一维或多维的给定矩阵的共轭

示例 #1:
在这个例子中,我们可以看到matrix.conj()方法用于共轭矩阵。记住字符串类型的矩阵在这里不起作用。

# import the important module in python
import numpy as np
           
# make an array with numpy
gfg = np.matrix('[1 + 2j, 2 + 3j]')
           
# applying matrix.conj() method
geeks = gfg.conj()
     
print(geeks)
输出:
[[ 1.-2.j  2.-3.j]]

示例 #2:

# import the important module in python
import numpy as np
           
# make an array with numpy
gfg = np.matrix('[1 + 2j, 2 + 3j, 3-2j; 1-4j, 2-3j, 7 + 8j]')
           
# applying matrix.conj() method
geeks = gfg.conj()
     
print(geeks)
输出:
[[ 1.-2.j  2.-3.j  3.+2.j]
 [ 1.+4.j  2.+3.j  7.-8.j]]