Numpy 中的矩陣向量乘法

結論: 元素乘法:np.multiply(a,b) 矩陣乘法:np.dot(a,b) 或 np.matmul(a,b) 或 a.dot(b) 或直接用 a @ b ! 惟獨注意:*,在 np.array 中重載爲元素乘法,在 np.matrix 中重載爲矩陣乘法!python 對於 np.array 對象 >>> a array([[1, 2], [3, 4]]) 元素乘法 用 a*
相關文章
相關標籤/搜索