Exercise 551
Given two matrixes A and B:
![](https://1.bp.blogspot.com/-SxVJyP-eHRU/X2TuTgG9gLI/AAAAAAAAB3w/xbzJLyBAM54AwhrjEZbrQM1iQ8HaghxLQCLcBGAsYHQ/s16000/product-ofmatrix-andtranspose-matrix-vector-numpy-python-courses.png)
Give the numpy python code which calculates t(B)A (the inner product or dot product)
Solution
import numpy as np
A = np.array([[3,2] ,
[2,3]])
B = np.array([[1,0] ,
[4,-1]])
X = np.dot(B.T, A)
print("The product t(B)A is : " , X)
# The out put is : The product t(B)A is : [[11 14] [-2 -3]]
Younes Derfoufi
my-courses.net
my-courses.net