scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersRaisesReturnsBackRef
inv(a, overwrite_a=False, check_finite=True)

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 : bool, optional

Whether to check that the input matrix contains only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs.

Raises

LinAlgError

If a is singular.

ValueError

If a is not square, or not 2D.

Returns

ainv : ndarray

Inverse of the matrix a.

Compute the inverse of a matrix.

Examples

>>> from scipy import linalg
... a = np.array([[1., 2.], [3., 4.]])
... linalg.inv(a) array([[-2. , 1. ], [ 1.5, -0.5]])
>>> np.dot(a, linalg.inv(a))
array([[ 1.,  0.],
       [ 0.,  1.]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.sparse.linalg._matfuncs.inv scipy.linalg._basic.inv

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/linalg/_basic.py#900
type: <class 'function'>
Commit: