Title: Invert A Matrix
Slug: invert_a_matrix
Summary: How to invert a matrix in Python.
Date: 2017-09-03 12:00
Category: Machine Learning
Tags: Vectors Matrices Arrays
Authors: Chris Albon
In [1]:
# Load library
import numpy as np
In [2]:
# Create matrix
matrix = np.array([[1, 4],
[2, 5]])
In [3]:
# Calculate inverse of matrix
np.linalg.inv(matrix)
Out[3]: