Skip to content

Instantly share code, notes, and snippets.

@Francis-Lee-Earth
Created October 11, 2018 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Francis-Lee-Earth/033126b2a94611ba9daa58436a7e7ffe to your computer and use it in GitHub Desktop.
Save Francis-Lee-Earth/033126b2a94611ba9daa58436a7e7ffe to your computer and use it in GitHub Desktop.
Matrix Inverse
import numpy as np
a = np.array([
[1, -2, -1],
[2, -1, 1],
[3, -6, -5]
])
a_inv = np.linalg.inv(a)
print("A:")
print(a)
print()
print("Inverse:")
print(a_inv)
print()
print("Identities:")
print(a.dot(a_inv))
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment