Matrix Dot Product
The dot product of two matrices is slightly more limited than the element-wise multiplication in that not all matrices can be multiplied together. The basic rule of the dot product is that, the number of columns in one matrix must be equal to the number of rows in the other.
Suppose matrices $A$ and $B$
$$A_{m,n}, B_{n,p} $$
The dot product is represent as :
$$ C_{m,p} = A_{m,n} \bullet B_{n,p} $$
Example:
Given matrics $A$ and $B$ below:
$$ A = \begin{pmatrix} a_{1,1} & a_{1,2} \\ a_{2,1} & a_{2,2} \\ a_{3,1} & a_{3,2} \end{pmatrix} , B = \begin{pmatrix} b_{1,1} & b_{1,2} \\ b_{2,1} & b_{2,2} \end{pmatrix} $$
Then their dot-product is:
$$ C = \begin{pmatrix} a_{1,1}*b_{1,1} + a_{1,2}*b_{2,1} & a_{1,1}*b_{1,2} + a_{1,2}*b_{2,2} \\ a_{2,1}*b_{1,1} + a_{2,2}*b_{2,1} & a_{2,1}*b_{1,2} + a_{2,2}*b_{2,2} \\ a_{3,1}*b_{1,1} + a_{3,2}*b_{2,1} & a_{3,1}*b_{1,2} + a_{3,2}*b_{2,2} \\ \end{pmatrix} $$
Real Examples
$$ A = \begin{pmatrix} 2 & 1 \\ 3 & 2 \\ 5 & 5 \end{pmatrix} , B = \begin{pmatrix} 1 & 1 \\ 1 & 2 \end{pmatrix} $$
$$ C = \begin{pmatrix} 2*1 + 1*1 & 2*1 + 1*2 \\ 3*1 + 2*1 & 3*1 + 2*2 \\ 5*1 + 5*1 & 5*1 + 5*2 \\ \end{pmatrix} = \begin{pmatrix} 3 & 4 \\ 5 & 7 \\ 10 & 15 \\ \end{pmatrix} $$
Implementation in Numpy
import numpy as np
A = np.array([2,1,3,2,5,5]).reshape(3,2)
B = np.array([1,1,1,2]).reshape(2,2)
A.dot(B)