Re: [問題] 高維矩陣內積

看板Python作者時間9年前 (2016/10/14 16:51), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
這是你要的嗎? a = np.array([[1,2],[3,4],[5,6],[7,8]]) array([[1, 2], [3, 4], [5, 6], [7, 8]]) b = np.array([1,2]) array([1, 2]) np.multiply(a.reshape(2,4).T, b).T.reshape(4,2) array([[ 1, 2], [ 3, 4], [10, 12], [14, 16]]) -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.41.112 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1476435083.A.3D7.html

10/15 13:56, , 1F
了解,感謝!
10/15 13:56, 1F
文章代碼(AID): #1O09oBFN (Python)
文章代碼(AID): #1O09oBFN (Python)