Have you ever tried to generate an inverse of ant matrix or ndArray. It looks quiet difficult to do it manually but in python it is very easy.
This python source code does the following:
1. Creates custom numpy matrix
2. Uses "linalg" and inverse function to calulate inverse of a matrix
So this is the recipe on how we can Invert a Matrix or ndArray
import numpy as np
We have only imported numpy which is needed.
We have created a matrix using array and we will find inverse of this.
matrix = np.array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
We can find the inverse of the martix by using np.linalg.inv and passing the matrix.
Inv = np.linalg.inv(matrix)
So the output comes as
[[ 3.15251974e+15 -6.30503948e+15 3.15251974e+15] [-6.30503948e+15 1.26100790e+16 -6.30503948e+15] [ 3.15251974e+15 -6.30503948e+15 3.15251974e+15]]