numpy.dot()

This function returns the dot product of two arrays. For 2-D vectors, it is the equivalent to matrix multiplication. For 1-D arrays, it is the inner product of the vectors. For N-dimensional arrays, it is a sum product over the last axis of a and the second-last axis of b.

import numpy.matlib
import numpy as np

a = np.array([[1,2],[3,4]])
b = np.array([[11,12],[13,14]])
np.dot(a,b)

It will produce the following output −

[[37  40]
[85  92]]

Note that the dot product is calculated as −

[[1*11+2*13, 1*12+2*14],[3*11+4*13, 3*12+4*14]]
numpy_linear_algebra.htm

Useful Video Courses

Video

Python Data Science basics with Numpy, Pandas and Matplotlib

63 Lectures 6 hours

Video

Data Analysis using NumPy and Pandas

Most Popular

19 Lectures 8 hours

Video

Numpy with Python

12 Lectures 3 hours

Video

Basics Data Science with Numpy, Pandas and Matplotlib

10 Lectures 2.5 hours

Video

NumPy For Data Science & Machine Learning:: From Beginner To Advanced Level

20 Lectures 2 hours

Video

Pandas Crash Course for begineers : Numpy + Pandas + Matplotlib

Featured

63 Lectures 6 hours