python 下三角矩阵
A matrix can be seen in different ways and one of them is the lower triangular matrix part. Some problems in linear algebra are concerned with the lower triangular part of the matrix.
可以用不同的方式看到矩阵,其中之一是下部三角形矩阵部分。 线性代数中的一些问题与矩阵的下三角部分有关 。
For this purpose, we have a predefined function numpy.tril(a) in the NumPy library package which automatically stores the lower triangular elements in a separate matrix. In this article, we are going to print the lower triangular elements of a matrix using inbuilt function numpy.tril(a).
为此,我们在NumPy库包中提供了预定义的函数numpy.tril(a) ,该函数自动将下部三角形元素存储在单独的矩阵中。 在本文中,我们将使用内置函数numpy.tril(a)打印矩阵的下三角元素 。