NumPy Matrices + Matrix Math
Numpy matrices are strictly 2-dimensional, while numpy arrays (ndarrays) are N-dimensional. Matrix objects are a subclass of ndarray, so they inherit all the attributes and methods of ndarrays.
The main advantage of numpy matrices is that they provide a convenient notation for matrix multiplication.
This example shows how to define two NumPy matrices, how to multiply them. It also shows the difference if they were NumPy arrays and how multiplying the same two arrays give you different values. You have to use a different function (dot) to get it. (Mathematicians find this backwards.)
References