title: Python Split Array use For Loop to Mean every split and put it back together
body: <p>I'm coding for an Coherence project and I'm now stuck at the problem to mean my array of values in splitted parts.</p>
  
  <p>So ym task would be:
  1. Take my array of values (R) split it in a certain number of array parts (split by epoch)
  2. enter a loop to run it automatically.
  3. in the loop every value of each split part of the original array should be avaraged</p>
  
  <p>Maybe the solution is damn simple, but I got stuck and I miss the wood for the forest.</p>
  
  <p>Here is my approach (Rxx, epochs are defined above):</p>
  
  <pre><code>epoch_Rxx = np.array_split(Rxx,epochs)
  for i in range(0,epochs):
  Rxx_mean = np.zeros(epochs)
  Rxx_mean[i] = np.mean(Rxx[i])
  </code></pre>
  
  <hr>
  
  <p>In the end I want from the e.g. Rxx = 100 values  and epochs = 10</p>
  
  <p>--> Rxx_mean = 10 values each to be the avaraged value of each epoch. </p>
  
  <p>Greetings,</p>
  
  <p>Daniel</p>