numpy.matmul (ary1, ary2):

import numpy as np
list1 = [1,2,3]
list2 = [
[3],
[2],
[1]]
a1 = np.array(list1)
a2 = np.array(list2)
print(“對list做矩陣乘法np.matmul():”,
np.matmul(list1,list2))
print(“對array做矩陣乘法np.matmul():”,
np.matmul(a1,a2))
print(“只有array能用@做矩陣乘法:”,a1 @ a2)
print(“矩陣乘法@:”,list1 @ list2)

numpy.dot()

推薦hahow線上學習python: https://igrape.net/30afN







![Python `os.environ[“PATH”]`(設定 *.exe 路徑)vs `sys.path`(設定 *.py 路徑)教學:用 Whisper 與 ffmpeg 看懂兩種很像的 path Python `os.environ[“PATH”]`(設定 *.exe 路徑)vs `sys.path`(設定 *.py 路徑)教學:用 Whisper 與 ffmpeg 看懂兩種很像的 path](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2026/05/20260513130826_0_8d5fb3.png?quality=90&zoom=2&ssl=1&resize=350%2C233)


近期留言