python dot(a,b) analysis of rectangular operation rules

For a novice like me who is learning python, python's operation rules seem overwhelming. Today we will learn together the dot function
import numpy as pn in python
Write picture description here

First, the corresponding first set of arrays is [[10,20], [30,40]] and the
second set of arrays is [[4,3], [2,1]
. There are two types of multiplication operations in python. One is multiply(a,b) , the operation corresponding to the element: the result is [[40, 60], [60, 40].
Then the second one is the dot(a,b) operation, the operation rules Is the rule for performing rectangular operations. I have returned these to my advanced mathematics teacher, so today we will study the rules of rectangular operations.

Write picture description here

Then we will inevitably get a set of rectangular arrays through rectangular operations, so how do we fill in the numbers in the middle?

我们知道两条直线可以定位一个点,那根据一个点也可以分别画出两条直线了。

Fill in the rules in the third blank

Then, we find the corresponding number arrangement by drawing a straight line in the rectangle. Should it be these numbers:
The third blank
Then we have also found the arrays [30,40], [4,2], then we have to calculate the sum of their losses, 30*4+40*2 = 200;

Okay, now that we have determined the value of the third space, let’s continue:
second space

Now that we have found [10,20],[3,1], we operate according to the rules: 10*3+20*1 = 50; we operate in
turn and finally get the result:
result
Haha, does it feel very simple now? Woolen cloth

I am a novice and it is my first time to write a py blog. If there are any shortcomings or misunderstandings, I hope you can point them out. Thank you.

The article is inspired by: https://zh.wikihow.com/%E8%AE%A1%E7%AE%97%E7%9F%A9%E9%98%B5%E4%B9%98%E6%B3% 95

Guess you like

Origin blog.csdn.net/chenluming210/article/details/78361947