借助於sympy.Matrix().columnspace()方法,我們可以找到矩陣的列空間。 Matrix().columnspace()返回跨越矩陣的列空間的列向量列表。
用法: Matrix().columnspace()
返回值:返回跨越矩陣的列空間的列向量的列表。
示例1:
# import sympy
from sympy import *
M = Matrix([[1, 0, 1, 3], [2, 3, 4, 7], [-1, -3, -3, -4]])
print("Matrix : {} ".format(M))
# Use sympy.columnspace() method
M_columnspace = M.columnspace()
print("Columnspace of a matrix : {}".format(M_columnspace))
輸出:
Matrix : Matrix([[1, 0, 1, 3], [2, 3, 4, 7], [-1, -3, -3, -4]]) Columnspace of a matrix : [Matrix([ [ 1], [ 2], [-1]]), Matrix([ [ 0], [ 3], [-3]])]
示例2:
# import sympy
from sympy import *
M = Matrix([[14, 0, 11, 3], [22, 23, 4, 7], [-12, -34, -3, -4]])
print("Matrix : {} ".format(M))
# Use sympy.columnspace() method
M_columnspace = M.columnspace()
print("Columnspace of a matrix : {}".format(M_columnspace))
輸出:
Matrix : Matrix([[14, 0, 11, 3], [22, 23, 4, 7], [-12, -34, -3, -4]]) Columnspace of a matrix : [Matrix([ [ 14], [ 22], [-12]]), Matrix([ [ 0], [ 23], [-34]]), Matrix([ [11], [ 4], [-3]])]
相關用法
- Python sympy.crt()用法及代碼示例
- Python sympy.apart()用法及代碼示例
- Python sympy RGS用法及代碼示例
- Python sympy.Mul()用法及代碼示例
- Python sympy.gcd()用法及代碼示例
- Python sympy.cot()用法及代碼示例
- Python sympy.div()用法及代碼示例
- Python sympy.Add()用法及代碼示例
- Python sympy.csc()用法及代碼示例
- Python sympy.lcm()用法及代碼示例
- Python sympy.sec()用法及代碼示例
- Python sympy.Pow()用法及代碼示例
- Python sympy.ff()用法及代碼示例
- Python sympy.rf()用法及代碼示例
- Python sympy.gcd()用法及代碼示例
注:本文由純淨天空篩選整理自rupesh_rao大神的英文原創作品 Python sympy | Matrix.columnspace() method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。