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
这个指定条状图