title: Gaussian Sum with python
body: <p>I found this code : </p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  # We create 1000 realizations with 200 steps each
  n_stories = 1000
  t_max = 500
  
  t = np.arange(t_max)
  # Steps can be -1 or 1 (note that randint excludes the upper limit)
  steps = 2 * np.random.randint(0, 1 + 1, (n_stories, t_max)) - 1
  
  # The time evolution of the position is obtained by successively
  # summing up individual steps. This is done for each of the
  # realizations, i.e. along axis 1.
  positions = np.cumsum(steps, axis=1)
  
  # Determine the time evolution of the mean square distance.
  sq_distance = positions**2
  mean_sq_distance = np.mean(sq_distance, axis=0)
  
  # Plot the distance d from the origin as a function of time and
  # compare with the theoretically expected result where d(t)
  # grows as a square root of time t.
  plt.figure(figsize=(10, 7))
  plt.plot(t, np.sqrt(mean_sq_distance), 'g.', t, np.sqrt(t), 'y-')
  plt.xlabel(r"$t$")
  plt.tight_layout()
  plt.show()
  </code></pre>
  
  <p>Instead of doing just steps -1 or 1 , I would like to do steps following a standard normal distribution ... when I am inserting np.random.normal(0,1,1000) instead of np.random.randint(...) it is not working.</p>
  
  <p>I am really new to Python btw.</p>
  
  <p>Many thanks in advance and Kind regards</p>