Linear systems
Solve equations of the form A @ x = b.
NumPy · Module
numpy.linalg is NumPy's linear algebra namespace for standard matrix and vector computations. Its routines include solving systems, decompositions, eigenvalue calculations, norms, inverses, and matrix products.
Importing numpy.linalg gives access to NumPy's linear algebra routines. The module provides standard operations such as solving systems, computing inverses and determinants, decompositions, eigenvalues, norms, and matrix products, with implementations relying on BLAS and LAPACK.
import numpy.linalg| Name | Type | Description |
|---|---|---|
| | No parameters; this card describes the module namespace rather than one callable. |
No direct return value; importing the module exposes linear algebra functions and routines.
import numpy as np
A = np.array([[3.0, 1.0], [1.0, 2.0]])
b = np.array([9.0, 8.0])
x = np.linalg.solve(A, b)
print(x) # [2. 3.]
Solves the square linear system A @ x = b.
Solve equations of the form A @ x = b.
Analyze matrix structure through eigenvalues and eigenvectors.
Factor matrices or compute singular values for numerical analysis.
Calculate inverses, determinants, norms, and products.
numpy.linalg.eignumpy.linalg.eigvalshnumpy.linalg.solvenumpy.linalg.invnumpy.linalg.svdnumpy.linalg.tracenumpy.linalg.matmul