scipy.linalg.inv

scipy.linalg.inv(a, overwrite_a=False)

Compute the inverse of a matrix.

Parameters :

a : array-like, shape (M, M)

Matrix to be inverted

Returns :

ainv : array-like, shape (M, M)

Inverse of the matrix a

Raises LinAlgError if a is singular :

Examples

>>> a = array([[1., 2.], [3., 4.]])
>>> inv(a)
array([[-2. ,  1. ],
       [ 1.5, -0.5]])
>>> dot(a, inv(a))
array([[ 1.,  0.],
       [ 0.,  1.]])

Previous topic

scipy.linalg.triu

Next topic

scipy.linalg.solve

This Page