numpy使用介绍
- 2025-11-01 23:43:00
- admin
- 原创 56
一、numpy使用介绍
1、代码仓库:https://github.com/numpy/numpy
2、帮助文档:https://numpy.org/doc/stable/user/absolute_beginners.html
3、np.random.normal(loc, scale, size),从正态分布X~N(loc ,scale^2)抽取size个样本;
4、np.random.Generator.normal(loc, scale, size),从正态分布X~N(loc ,scale^2)抽取size个样本;
5、np.ndarray.round(decimals),数组中的每个元素保留多少位小数;
抽取样本:
rng = np.random.default_rng(seed)
rng.normal(loc, scale, size)
发表评论