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.
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.