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) ...