Linear algebra (numpy.linalg)

Matrix and vector products

dot ()
vdot (a, b) Return the dot product of two vectors.
inner (a, b) Inner product of two arrays.
outer (a, b) Returns the outer product of two vectors.
tensordot (a, b[, axes]) Returns the tensor dot product for (ndim >= 1) arrays along an axes.
linalg.matrix_power (M, n) Raise a square matrix to the (integer) power n.
kron (a, b) Kronecker product of two arrays.


linalg.cholesky (a) Cholesky decomposition.
linalg.qr (a[, mode]) Compute QR decomposition of a matrix.
linalg.svd (a[, full_matrices, compute_uv]) Singular Value Decomposition.

Matrix eigenvalues

linalg.eig (a) Compute eigenvalues and right eigenvectors of an array.
linalg.eigh (a[, UPLO]) Eigenvalues and eigenvectors of a Hermitian or real symmetric matrix.
linalg.eigvals (a) Compute the eigenvalues of a general matrix.
linalg.eigvalsh (a[, UPLO]) Compute the eigenvalues of a Hermitean or real symmetric matrix.

Norms and other numbers

linalg.norm (x[, ord]) Matrix or vector norm.
linalg.cond (x[, p]) Compute the condition number of a matrix.
linalg.det (a) Compute the determinant of an array.
trace (a[, offset, axis1, axis2, ...]) Return the sum along diagonals of the array.

Solving equations and inverting matrices

linalg.solve (a, b) Solve the equation a x = b for x.
linalg.tensorsolve (a, b[, axes]) Solve the tensor equation a x = b for x
linalg.lstsq (a, b[, rcond]) Return the least-squares solution to an equation.
linalg.inv (a) Compute the inverse of a matrix.
linalg.pinv (a[, rcond]) Compute the (Moore-Penrose) pseudo-inverse of a matrix.
linalg.tensorinv (a[, ind]) Find the ‘inverse’ of a N-d array


linalg.LinAlgError # Error object