piestats is a bare bones library that samples from a multivariate normal distribution.
from Random import Multivariate_Normal
import matplotlib.pyplot as plt
plt.style.use("ggplot")
cov = np.array([[1, 3], [2, 1]])
x1, x2 = Multivariate_Normal(size=10000, cov=cov)
plt.hist2d(x1, x2, bins=50, cmap='Blues') # https://jakevdp.github.io/PythonDataScienceHandbook/04.05-histograms-and-binnings.html
cb = plt.colorbar()
cb.set_label('counts in bin')
computers don't know anything about gaussian distributions. they only know uniform distributions, which can be generated from psuedo random numbers. so how do libraries like numpy.random.multivariate_normal emit samples from multivariate distributions?
first, piestats draws from a uniform distribution. this is a primitive operation that all computers know how to perform. then, it converts these samples into a 1d normal distribution through box muller transformation. finally, it reshapes these normally distribution samples by the specified covariance.