If I have N particles how do I assign their x values so that the end result is Gaussian distribution. i.e. particles near the ends are more spread out than particles near the center.
This doesn't randomly sample points, but instead chooses representative points deterministically.
scipy.stats.norm.ppf(np.linspace(0, 1, 1000+2)[1:-1])
NumPy comes with a nifty random library with various distributions, including normal (Gaussian).
From the Numpy documentation:
mu, sigma = 0, 0.1 # mean and standard deviation s = np.random.normal(mu, sigma, 1000)
which will give you 1000 normally distributed values with mean mu and standard deviation sigma.