In this article we briefly introduce some of NumPy's linear algebra and
polynomial functionality.
Linear algebra
NumPy includes linear algebra routines that can be quite handy.
For example, NumPy can calculate matrix and vector products efficiently (dot, vdot), solve eigenproblems (linalg.eig, linalg.eigvals), solve linear systems (linalg.solve), and do matrix inversion (linalg.inv).
Normally, NumPy utilises high performance numerical libraries in linear algebra operations. This means that the performance of NumPy is actually quite good and not far e.g. from the performance of a pure-C implementations using the same libraries.
Polynomials
NumPy has also support for polynomials. One can for example do least square fitting, find the roots of a polynomial, and evaluate a polynomial.
A polynomial f(x) is defined by an 1D array of coefficients (p) with length N, such that (f(x) = p[0] x^{N-1} + p[1] x^{N-2} + … + p[N-1]).