看板 Python 關於我們 聯絡資訊
這是你要的嗎? 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
ice80712: 了解,感謝! 10/15 13:56