### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.12 Reference Guide (DRAFT) »
- Linear algebra (`scipy.linalg`) »

# scipy.linalg.inv

`scipy.linalg.``inv`(a, overwrite_a=False, check_finite=True)

  Compute the inverse of a matrix.

  Parameters : | a : array_like Square matrix to be inverted. overwrite_a : bool, optional Discard data in a (may improve performance). Default is False. check_finite : boolean, optional Whether to check the input matrixes contain only finite numbers. Disabling may give a performance gain, but may result to problems (crashes, non-termination) if the inputs do contain infinities or NaNs.
  Returns : | ainv : ndarray Inverse of the matrix a.
  Raises : | LinAlgError : : If a is singular. ValueError : : If a is not square, or not 2-dimensional.

  Examples

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

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.12 Reference Guide (DRAFT) »
- Linear algebra (`scipy.linalg`) »