sympy.Matrix.col()方法
利用sympy.Matrix().col()方法,我们可以提取出矩阵的列。
语法:sympy.Matrix.col()
返回:返回矩阵的col。
sympy.Matrix.col()方法 例# 1:
在给定的示例中,我们可以看到使用了sympy.Matrix.col()方法来提取矩阵的列。
# Import all the methods from sympy from sympy import * # use the col() method for matrix gfg_val = Matrix([[1, 2], [2, 1]]).col(1) print(gfg_val)
Output :
Matrix([[2], [1]])
sympy.Matrix.col()方法 例# 2:
from sympy import * # use the col() method for matrix gfg_val = Matrix([[1, 2], [2, 3], [23, 45]]).col(0) print(gfg_val)
Output :
Matrix([[1], [2], [23]])
版权声明:本页面内容旨在传播知识,为用户自行发布,若有侵权等问题请及时与本网联系,我们将第一时间处理。E-mail:284563525@qq.com