62.Example Programs using numpy and pandas
Add two matrix and find the transpose of the result ( university question) def readmatrix(x,r,c): for i in range(r): for j in range(c): x[i][j]=int(input('enter elements row by row')) import numpy as np r1=int(input('rows of a')) c1=int(input('columns of a')) r2=int(input('rows of b')) c2=int(input('columns of b')) if r1!=r2 or c1!=c2: print("cant add matrices") else: A=np.zeros((r1,c1)) print("Enter the elements of A") readmatrix(A,r1,c1) B=np.zeros((r2,c2)) print("Enter the elements of B") readmatrix(B,r2,c2) print("Matrix A") print(A) print("Matrix B") print(B) C=A+B print("sum") print(C) print("transpose of sum") print(C.T) Solving system of linear equations(university questions) let 2x1+3x2 +5x3= 10 3x1-2x2+x3=3 x1+5x2+7x3=8 import numpy as np A=np.array([[ 2 , 3,