Solving linear systems
A matrix transforms a vector into another vector in a linear way. This transformation mathematically corresponds to a system of linear equations. The numpy.linalg
function solve()
solves systems of linear equations of the form Ax = b
, where A
is a matrix, b
can be a one-dimensional or two-dimensional array, and x
is an unknown variable. We will see the dot()
function in action. This function returns the dot product of two floating-point arrays.
The dot()
function calculates the dot product (see https://www.khanacademy.org/math/linear-algebra/vectors_and_spaces/dot_cross_products/v/vector-dot-product-and-vector-length). For a matrix A
and vector b
, the dot product is equal to the following sum:
Get NumPy : Beginner's Guide - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.