This time for you to bring numpy array and matrix multiplication how to use, using NumPy array and matrix multiplication of considerations, the following is the actual case, together to see.
1, when an array, the default d*f is the product of the corresponding elements, multiply is also the product of the corresponding elements, dot (d,f) will be converted to the product of the matrix, dot point multiplication means the addition, and multiply is only the corresponding elements multiplied, not added
2, when the mat, the default d*f is the product of the matrix, multiply into the product of the corresponding element, dot (d,f) is the product of the matrix
3. in mixed situations, do not mix in general
When blending, by default, the multiply is converted to the product of the corresponding element by matrix multiplication, and Dot (d,f) is the product of the matrix.
Summary: array multiplication By default is the point multiplication, matrix default is the matrix multiplication, the default is the matrix multiplication, multiply conversion to the corresponding element of the product, Dot (d,f) will be converted to the product of the matrix, note, like multiply does not meet the corresponding element, According to the broadcast is the way.
Believe that you have read the case of this article you have mastered the method, more exciting please pay attention to the PHP Chinese network other related articles!
Recommended reading:
Python implementation method of solving greatest common divisor
How the python numpy array is merged