title: numpy.AxisError: axis 1 is out of bounds for array of dimension 1 - numpy array
body: <p>I am trying to get the cumulative sum of an array which has a shape of: (1000, 117)</p>
  
  <p>But it seems that the array is taken as vector and the "numpy.cumsum" output comes out as a 117000 size vector instead of a (1000, 117) dimension matrix
  These are the code lines and their outputs in # :</p>
  
  <pre><code>print(np.shape(rates))
  #(1000, 117)
  cum_rates = numpy.cumsum(rates[:, -1], axis = 1)
  #numpy.AxisError: axis 1 is out of bounds for array of dimension 1
  </code></pre>
  
  <p>Here is how I created the rates array:</p>
  
  <pre class="lang-py prettyprint-override"><code>rates = np.zeros([taille, pas+1])
  rates[:, 0] = r0
  for i in range(pas):
      z = np.random.normal(taille)
      x[:, i+1] = x[:, i] + kappa*(theta - x[:, i])*dt + sigma*np.sqrt(x[:, i])*z*dt
      rates[:, i+1] = x[:, i+1] + phi[i]
  </code></pre>
  
  <p>How do you suggest I solve this probelm?</p>
  
  <p>Precision: the <code>"rates[:,-1]"</code> was to drop one column of the rates matrix</p>
  
  <p>Finally, I put the actual index instead of the -1 and it seems to have worked...</p>