Dot Product of two numpy array

A @ B in numpy python will also compute dot product of to array, just like,B) or — NumPy v1.23 Manual.

You are right Gaurav.
Dot Product can be performed in many ways
We need to look for the dimensions of both the arrays in performing the dot product.
Array1 shape : (m,n)
Array2 shape: (n,k)
Then the output array will be of shape (m,k)
The number of rows in the first array should match the number of columns in the 2nd array.
If the arrays are 1-dimensional, both of them should have the same shape.

  1. We can use,b)

  2. You can use .T(transpose function) to change the dimensions of the arrays and then apply the dot product. If the arrays are multi-dimensional and are of the same shape, then the dot product operation doesn’t work.
    Screen Shot 2022-07-02 at 12.59.53 AM

We can also try for applying transpose to either of the vectors. The resultant vector shape depends on which vector we apply the transpose.

I’ve added the screenshots of the implementation
Screen Shot 2022-07-02 at 1.01.32 AM

Just to add to your thought