title: Double Summation in Python
body: <p>I am trying to write a code to conduct a double summation (see pic) </p>
  
  <p><img src="https://i.stack.imgur.com/Lcp95.png" alt="enter image description here"></p>
  
  <p>in which; 
  M is the subjects,
  N is the Trials,
  Yijt is the measured wave form data (3d array)</p>
  
  <p>so far I have; 
  Given Y is the data arranged as Y[subjects, trials, time] </p>
  
  <pre><code># ranges:
  I = len(Y)
  J = len(Y[0])
  
  Y_i_vals = 0
  
  for i in range(M):
      for j in range(N):
          Y_i_vals = Y_i_vals +Y[i][j]
  Yt = (1.0/(M*N)) * Y_i_vals
  </code></pre>
  
  <p>this doesnt seem the most effective way to do this, nor am i certain it is giving the correct result. </p>