title: Calculating the Cumulative Mean in Python
body: <p>i am new on programming and python. I made a simulation mm1 queue. I ran it properly. I took the results. I have an 5000 output. But now i should calculate the cumulative mean of average delays for every 100 period(1 to 100, 1 to 200... until 1 to 5000).</p>
  
  <pre><code>#data 4 (delay time) set assign to list of numpy array
  npdelaytime = np.array(data[4][0:5000])  
  #reshape the list of delay time 100 customer in each sample
  npdelayreshape100 = np.reshape(npdelaytime, (-1,100))     
  #mean of this reshape matrix
  meandelayreshape100 = np.mean(npdelayreshape100, axis=1)  
  cumsummdr100 = np.cumsum(meandelayreshape100)
  a = range(1,51)     
  meancsmdr100 = cumsummdr100 / a
  </code></pre>
  
  <p>I can figure this out like this. First reshape the 5000 sample point into to 100*50. Then taking the means of these matrix. Lastly cumsum of these means.</p>
  
  <p><strong>My Question :</strong> Is there a easy way to do this ? </p>