【Numpy基礎】矩陣數組相乘

# 矩陣乘以數組 A = np.array([[1,2],[3,4],[5,6]]) A.shape # (3, 2) B = np.array([7,8]) B.shape # (2,) A.dot(B) # array([23, 53, 83]) B這個一維數組會被當成列向量使用。 反過來,一維數組在前,矩陣在後的情況如下: X = np.array([1,2]) X.shape # (2,
相關文章
相關標籤/搜索