numpy.dot() in Python

Python numpy.dot() function returns dot product of two vactors. Two Dimensional actors can be handled as matrix multiplication and the dot product will be returned.

Basic Syntax

Following is the basic syntax for numpy.dot() function in Python:

numpy.dot(vector_a,vector_b)

And the parameters are:

ParameterDescription
vector_aFirst vector for dot product.
vector_bSecond vector for dot product

Return Value

numpy.dot() function returns dot product of given two vectors.

Example

Following are the examples for numpy.dot() function

Example 1

The output for the above program is as given below:

Dot Product : (-13+66j)
Dot product : [[ 66, 77],[118, 137]]

Example 2

The output for the above program is as given below:

Dot product : 21
Dot product : 72

LEAVE A REPLY

Please enter your comment!
Please enter your name here