1.
a = np.array([[1.0, 2.0], [3.0, 4.0]])
a.transpose()
這個函數,是求a的轉置
2.
np.linalg.inv() 矩陣求逆
np.linalg.det() 矩陣求行列式(標量)
np.eye(2) 二階單位陣
np.trace(u) 矩陣u的跡(對角線元素相加)
np.linalg.solve(a, y) 求aX=y的線性方程組的解
np.linalg.eig(j) 求特徵值和特徵向量
(array([ 0.+1.j, 0.-1.j]), array([[ 0.70710678+0.j , 0.70710678-0.j ],
[ 0.00000000-0.70710678j, 0.00000000+0.70710678j]]))
3.
a = np.arange(30)
a.shape = 2, -1, 3
print(a.shape) 2,5,3
其中“-1”是指:無論哪個長度都可以,但要滿足2,3的條件
4.
v = np.random.normal(mu,sigma,10000)
三個參數,mu和sigma指的正態分佈的兩個參數,最後10000指的是在條形圖中,條形的數量
plt.hist(v, bins=50, normed=1, color=)
*x : (n,) array or sequence of (n,) arrays
這個參數是指定每個bin(箱子)分佈的數據,對應x軸
bins : integer or array_like, optional
這個參數指定bin(箱子)的個數,也就是總共有幾條條狀圖
normed : boolean, optional
If True, the first element of the return tuple will be the counts normalized to form a probability density, i.e.,n/(len(x)`dbin)
這個參數指定密度,也就是每個條狀圖的佔比例比,默認爲1
color : color or array_like of colors or None, optional
這個指定條狀圖