
262 Introduction to Computational Models with Python
of the matrix eq uation by the inverse of matrix A. The fo llowing expression
shows this:
A
−1
AX = A
−1
B.
This results in
X = A
−1
B.
18.3 MATRIX MANIPULATION WITH NUMPY
Matrices are created and manipulated in Python by calling the var ious library
functions in the Numpy and Scipy packages. Before using a matrix, it needs
to be created. Matrices are cr eated in a similar manner tha n the one used to
create vectors.
18.3.1 Creating, Initializi ng, and Indexing Matrices
The most straightforward way to create a matrix with Numpy is to call func-
tion array and specify the values in the matrix arranged in