借助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]]
相關用法
- Python Numpy numpy.ndarray.__mod__()用法及代碼示例
- Python Numpy numpy.ndarray.__ge__()用法及代碼示例
- Python Numpy numpy.ndarray.__invert__()用法及代碼示例
- Python Numpy numpy.ndarray.__divmod__()用法及代碼示例
- Python Numpy numpy.ndarray.__eq__()用法及代碼示例
- Python Numpy numpy.ndarray.__pow__()用法及代碼示例
- Python Numpy numpy.ndarray.__rshift__()用法及代碼示例
- Python Numpy numpy.ndarray.__le__()用法及代碼示例
- Python Numpy numpy.ndarray.__lt__()用法及代碼示例
- Python Numpy numpy.ndarray.__gt__()用法及代碼示例
- Python Numpy numpy.ndarray.__truediv__()用法及代碼示例
- Python Numpy numpy.ndarray.__mul__()用法及代碼示例
- Python Numpy numpy.ndarray.__sub__()用法及代碼示例
- Python Numpy numpy.ndarray.__pos__()用法及代碼示例
- Python Numpy numpy.ndarray.__add__()用法及代碼示例
注:本文由純淨天空篩選整理自Jitender_1998大神的英文原創作品 Python | Numpy matrix.getI()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。