The dot in NumPy is the inner product of a vector when it is multiplied by a one-dimensional vector.
#-*-coding:utf8-*-
import NumPy as NP
X=np.array ([])
Y=np.array ([2,2])
Z=np.dot (x, y)
print (z)
Experimental results:
"C:\Program files\anaconda3\python.exe" d:/pycharmprogram/coding/ganzhiqi/test_dot.py
4
Process finished With exit code 0
The multiplication of the matrix when the multiplication of the multidimensional vectors is
#-*-coding:utf8-*-
import NumPy as NP
X=np.array ([])
Y=np.array ([[2],[2]])
Z=np.dot (x, y)
print (z)
Experimental results:
"C:\Program files\anaconda3\python.exe" d:/pycharmprogram/coding/ganzhiqi/test_dot.py
[4]
Process Finished with exit code 0
* Indicates a point multiplication, which corresponds to multiplication
#-*-coding:utf8-*-
import NumPy as NP
X=np.array ([])
Y=np.array ([2,2])
z=x*y
print (z)
Experimental results:
"C:\Program files\anaconda3\python.exe" d:/pycharmprogram/coding/ganzhiqi/test_dot.py
[2 2]
Process Finished with exit code 0
Outer indicates an external multiplication
#-*-coding:utf8-*-
import NumPy as np
a = [[1,2,3],[4,5,6]]
b = [[1,2],[4,5],[3,6]]
C = Np.outer (A, B) C6/>print (c)
Experimental results:
"C:\Program files\anaconda3\python.exe" d:/pycharmprogram/coding/ganzhiqi/test_dot.py
[[1 2 4 5 3 6]
[2 4 8 6]
[3 6 [9 ]
[4 8
] [5] 30]
[6 []]
Process finished with exit code 0