Triangular Matrix
A triangular matrix is a matrix with $n$ by $n$ dimension whose upper-triangle or lower-triangle values are fixed to zero. We have two types of triangular matrices. Upper Triangle and lower triangle.
An upper triangular matrix means that the lower values are set to zero
$$ A = \begin{pmatrix} 1 & 7 & 2 \\ 0 & 2 & 1 \\ 0 & 0 & 7 \end{pmatrix} $$
A lower triangular matrix means that the upper values are set to zero
$$ B = \begin{pmatrix} 2 & 0 & 0 & 0 \\ 4 & 2 & 0 & 0 \\ 2 & 7 & 5 & 0 \\ 2 & 3 & 2 & 1 \end{pmatrix} $$
Converting a matrix to triangular from in numpy
Numpy has utilities to convert regular matrices to triangular matrices.
A = np.array([3,2,1,4,5,6,2,3,1,3,4,2,1,2,3,1]).reshape(4,4)
A
Convert to Lower triangular matrix
np.tril(A)
Convert to Upper triangular matrix
np.triu(A)