Inverse of a matrix

The inverse $A^{-1}$ of a square matrix $A$ satisfies
\begin{displaymath}
A^{-1} A = A A^{-1} = I
\end{displaymath} (1)

where $I$ is the unit matrix (identity). The numpy.linalg can calculate it (if it exists)

> python3
Python 3.4.5 (default, Jun  1 2017, 13:52:39) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import numpy as np
>>> from numpy import linalg as LA
>>> Ainv = LA.inv(A)
>>> print(Ainv)
[[-0.25   0.25   0.25 ]
 [ 0.625 -0.125 -0.125]
 [ 0.125 -0.625  0.375]]
>>>