numpy生成服从特定分布(制定分布)的数据

使用numpy.random模块,文档地址:https://numpy.org/doc/1.16/reference/routines.random.html#distributions

以幂律分布为例:

import numpy as np

np.random.pareto(0.9, 2000)

以正态分布为例:

import numpy as np

np.random.normal(10, 5, 400)

更多分布及绘图也可以参考

Python Matplotlib Seaborn 可视化随机分布:https://www.cjavapy.com/article/1055/

猜你喜欢

转载自blog.csdn.net/weixin_35757704/article/details/115029067