I can generate Gaussian data with random.gauss(mu, sigma)
function, but how can I generate 2D gaussian? Is there any function like that?
If you can use numpy
, there is numpy.random.multivariate_normal(mean, cov[, size])
.
For example, to get 10,000 2D samples:
np.random.multivariate_normal(mean, cov, 10000)
where mean.shape==(2,)
and cov.shape==(2,2)
.