本文簡要介紹 python 語言中 scipy.linalg.tri
的用法。
用法:
scipy.linalg.tri(N, M=None, k=0, dtype=None)#
-
構造 (N, M) 矩陣,在第 k 個對角線及其下方填充一個。
對於 j <= i + k,矩陣有 A[i,j] == 1
- N: int
矩陣第一維的大小。
- M: int 或無,可選
矩陣第二維的大小。如果 M 為無,則假定 M = N。
- k: 整數,可選
低於其矩陣填充的次對角行數。 k = 0 是主對角線,k < 0 次對角線和 k > 0 超對角線。
- dtype: dtype,可選
矩陣的數據類型。
- tri: (N, M) ndarray
三矩陣。
參數 ::
返回 ::
例子:
>>> from scipy.linalg import tri >>> tri(3, 5, 2, dtype=int) array([[1, 1, 1, 0, 0], [1, 1, 1, 1, 0], [1, 1, 1, 1, 1]]) >>> tri(3, 5, -1, dtype=int) array([[0, 0, 0, 0, 0], [1, 0, 0, 0, 0], [1, 1, 0, 0, 0]])
相關用法
- Python SciPy linalg.tril用法及代碼示例
- Python SciPy linalg.triu用法及代碼示例
- Python SciPy linalg.tanhm用法及代碼示例
- Python SciPy linalg.tanm用法及代碼示例
- Python SciPy linalg.tfqmr用法及代碼示例
- Python SciPy linalg.toeplitz用法及代碼示例
- Python SciPy linalg.eigvalsh_tridiagonal用法及代碼示例
- Python SciPy linalg.cdf2rdf用法及代碼示例
- Python SciPy linalg.LaplacianNd用法及代碼示例
- Python SciPy linalg.solve_circulant用法及代碼示例
- Python SciPy linalg.polar用法及代碼示例
- Python SciPy linalg.clarkson_woodruff_transform用法及代碼示例
- Python SciPy linalg.rsf2csf用法及代碼示例
- Python SciPy linalg.hessenberg用法及代碼示例
- Python SciPy linalg.svd用法及代碼示例
- Python SciPy linalg.ishermitian用法及代碼示例
- Python SciPy linalg.invhilbert用法及代碼示例
- Python SciPy linalg.factorized用法及代碼示例
- Python SciPy linalg.lu_factor用法及代碼示例
- Python SciPy linalg.SuperLU用法及代碼示例
- Python SciPy linalg.lsqr用法及代碼示例
- Python SciPy linalg.cho_factor用法及代碼示例
- Python SciPy linalg.fractional_matrix_power用法及代碼示例
- Python SciPy linalg.eig_banded用法及代碼示例
- Python SciPy linalg.orthogonal_procrustes用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.linalg.tri。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。