import numpy as npA=np.array([[1.5,1],[3.75,4]])B=np.array([1800,900])x=np.linalg.solve(A,B)print(“Values of A and B variables:”,x)h=np.allclose(np.dot(A, x), B)print(“Substitution of two variables in equation to validate:”,h) Source link

## Operations on Matrices

import numpy as npA = np.array([[4,1,7],[2,1,8],[3 ,7,1]])B = np.array([[6,1,1],[2,1,5],[2,3,1]])C=A.dot(B)print(“Values of First 2D Matrixn”,A)print(“Values of Second 2D Matrixn”,B)print(“———————————————“)print(“Multiplication of Matricesn”,C)print(“n”)Ainv=np.linalg.inv(A)Binv=np.linalg.inv(B)print(“Inverse of First Matrixn”,Ainv)print(“Inverse of Second Matrixn”,Binv)print(“n”)AI=Ainv.dot(A)BI=Binv.dot(B)print(“Multiplication of First Matrix and their Inversen”,AI)print(“Multiplication of Second Matrix and their Inversen”,BI)AD=np.linalg.det(A)BD=np.linalg.det(B)print(“n”)print(“Determinant of First Matricx:”,AD)print(“Determinant