Dot Product

Numpy is powerful library for matrices computation. For instance, you can compute the dot product with np.dot

Syntax

numpy.dot(x, y, out=None)

Here,

x,y: Input arrays. x and y both should be 1-D or 2-D for the function to work

out: This is the output argument.For 1-D array scalar is returned. Other wise ndarray

Example:

## Linear algebra
### Dot product: product of two arrays
f = np.array([1,2])
g = np.array([4,5])
### 1*4+2*5
np.dot(f, g)

Output

14	

 

YOU MIGHT LIKE: