Thursday, 9 April 2020

Python之 np.outer 使用方法

np.outer(a,b)用途為計算矩陣的外積,將a當做列向量,b當做行向量,結果可得到一個矩陣

Python之 np.outer 使用方法如下


首先
import numpy as np
np.outer(np.array([4,5]),np.array([3,4]))

輸出結果
array([[12, 16],
       [15, 20]])

No comments:

Post a Comment

IIS HTTP Error 403.18

 HTTP Error 403.18 - Forbidden The specified request cannot be processed in the application pool that is configured for this resource on the...