How to use the multiplication of numpy arrays and matrices

Source: Internet
Author: User
Tags greatest common divisor
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.