Created
February 15, 2019 18:58
-
-
Save Robofied/c37f378657051e4bfabe2874227b3393 to your computer and use it in GitHub Desktop.
Numpy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##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