【发布时间】:2021-06-25 11:24:36
【问题描述】:
我有一个二维均值向量。
means = np.array([[0,0], [0, 3], [3,0], [3,3], [0, 5]])
我想使用这个均值向量生成随机正态数。 如果均值仅在 x 轴上,我会这样做:
x_samples = np.asarray(list(map(lambda mean: np.random.normal(mean, 1), x_means)))
有没有一种简单的方法可以同时生成 x 和 y 的样本? 谢谢
【问题讨论】:
标签: python numpy normal-distribution