Python Numpy matrix.getI()
在Numpy matrix.getI()方法的帮助下,我们可以得到与我们给定矩阵相同大小的乘法逆。
语法: matrix.getI()
返回:返回给定矩阵的乘法逆值
例子#1 :
在这个例子中,我们可以看到,在matrix.getI()方法的帮助下,我们能够得到乘法逆。
# import the important module in python
import numpy as np
# make matrix with numpy
gfg = np.matrix('[6, 1; 2, 3]')
# applying matrix.getI() method
geeks = gfg.getI()
print(geeks)
输出:
[[ 0.1875 -0.0625]
[-0.125 0.375 ]]
例子#2 :
# import the important module in python
import numpy as np
# make a matrix with numpy
gfg = np.matrix('[1, 2, 3; 4, 5, 6; 7, 8, 9]')
# applying matrix.getI() method
geeks = gfg.getI()
print(geeks)
输出:
[[ -4.50359963e+15 9.00719925e+15 -4.50359963e+15]
[ 9.00719925e+15 -1.80143985e+16 9.00719925e+15]
[ -4.50359963e+15 9.00719925e+15 -4.50359963e+15]]