Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Numpy
##importing libraries
import numpy.linalg as lnp
import numpy as np
## dot product for simple numbers.
np.dot(3,4)
#[Output]:
#12
## dot products for 1-d array
np.dot([2,3],[3,4])
#[Output]:
#18
## dot product for 2-d arrays
np.dot([[2,3],[3,4]],[[1,2],[5,6]])
#[Output]:
#array([[17, 22],
# [23, 30]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.