2017.7.13 && 笔记

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)          253

其中“-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

这个指定条状图

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值