numpy zeros矩阵_零矩阵使用numpy.zeros()| 使用Python的线性代数
numpy zeros矩陣
Zeros Matrix - When all the entries of a matrix are one, then it is called a zeros matrix. It may be of any dimension (MxN).
零矩陣 -當矩陣的所有條目均為1時,則稱為零矩陣。 它可以是任何尺寸( MxN )。
Properties:
特性:
The determinant of the matrix is 0.
矩陣的行列式為0。
The Rank of any zeros Matrix is 1.
任何零矩陣的秩為1。
In python, we have an inbuilt function (defined in numpy library) numpy.zeros() to define the zeros matrix. Here is the code with examples.
在python中,我們有一個內置函數(shù)(在numpy庫中定義) numpy.zeros()來定義零矩陣。 這是帶有示例的代碼。
使用numpy.zeros()的零矩陣的Python代碼 (Python code for zeros matrix using numpy.zeros())
# Linear Algebra Learning # Zeros Matriximport numpy as npa = np.zeros([3,5]) b = np.zeros([6,6]) c = np.zeros([9,5])#printing the matrices print("\n----Zeros Matrix (3x5)----\n",a) print("\n----Zeros Matrix (9x5)----\n",c) print("\n----Zeros Matrix (6x6)----\n",b)Output:
輸出:
----Zeros Matrix (3x5)----[[0. 0. 0. 0. 0.][0. 0. 0. 0. 0.][0. 0. 0. 0. 0.]]----Zeros Matrix (9x5)----[[0. 0. 0. 0. 0.][0. 0. 0. 0. 0.][0. 0. 0. 0. 0.][0. 0. 0. 0. 0.][0. 0. 0. 0. 0.][0. 0. 0. 0. 0.][0. 0. 0. 0. 0.][0. 0. 0. 0. 0.][0. 0. 0. 0. 0.]]----Zeros Matrix (6x6)----[[0. 0. 0. 0. 0. 0.][0. 0. 0. 0. 0. 0.][0. 0. 0. 0. 0. 0.][0. 0. 0. 0. 0. 0.][0. 0. 0. 0. 0. 0.][0. 0. 0. 0. 0. 0.]]翻譯自: https://www.includehelp.com/python/zeros-matrix-using-numpy-zeros.aspx
numpy zeros矩陣
總結
以上是生活随笔為你收集整理的numpy zeros矩阵_零矩阵使用numpy.zeros()| 使用Python的线性代数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 工程中多个不同类型线程池_软件工程中不同
- 下一篇: Java Object Class bo