Linear algebra is the branch of mathematics concerning linear equations by using vector spaces and through matrices. Matrix is the key to linear algebra. All the linear algebra revolves around matrices. Whenever we have to go for row operations, then we have to call our relevant row.
线性代数是使用向量空间和矩阵的线性方程组的数学分支。 矩阵是线性代数的关键。 所有线性代数都围绕矩阵旋转。 每当我们必须进行行操作时,就必须调用相关的行。
The following code shows how to call a whole row of a matrix.
以下代码显示了如何调用矩阵的整行。
用于调用矩阵行的Python代码 (Python code for calling row of a matrix)
# Linear Algebra Learning Sequence
# Calling row of a matrix
import numpy as np
# Use of np.array() to define a matrix
V = np.array([[1,2,3],[23,3,5],[33,68,87]])
row = 3
# Printing the 3rd row
print("---The Matrix V1---\n",V)
print("The Row 3 = ",V[row - 1])
Output:
输出:
---The Matrix V1---
[[ 1 2 3]
[23 3 5]
[33 68 87]]
The Row 3 = [33 68 87]
翻译自: https://www.includehelp.com/python/calling-row-of-a-matrix.aspx