Module matrix

Module matrix 

Source
Expand description

Matrix operations (eye, diag, kron, etc.) Matrix operations for ndarray

This module provides matrix creation and manipulation operations similar to those found in NumPy/SciPy, such as identity, diagonal, block, and other specialized matrix operations.

Functionsยง

_diag
Construct a diagonal matrix from a 1D array
block_diag
Create a block diagonal matrix from a sequence of 2D arrays
diagonal
Extract a diagonal from a 2D array
eye
Create an identity matrix
eye_offset
Create a matrix with ones on the given diagonal and zeros elsewhere
full
Create a matrix filled with a given value
hankel
Create a Hankel matrix from its first column and last row
kron
Compute the Kronecker product of two 2D arrays
ones
Create a matrix filled with ones
toeplitz
Create a Toeplitz matrix from first row and first column
trace
Calculate the trace of a square matrix (sum of diagonal elements)
tridiagonal
Create a tri-diagonal matrix from the three diagonals
vander
Create a matrix vander from a 1D array
zeros
Create a matrix filled with zeros