title: sum array inside for loop and call it outside of function
body: <p>Im trying to sum an array that has been populated by a loop, but i can only call the last value in the array. </p>
  
  <p>def nots():</p>
  
  <pre><code>global smhx
  
  tilt, lfo = genfromtxt('reso.csv',
          unpack=True, 
          delimiter=',')
  
  
  for t in xrange(2,5200):
  
          mrt=max(tilt[0:t])
  
          x= 1-((lfo[t-1]-lfo[0])/(mrt-lfo[0]))
  
          results=np.array([x])
  
          smhx=np.sum(results)
  
  
  
      print smhx/5200
  </code></pre>
  
  <p>Without saving the array to another file and then calling it outside the function, can someone suggest the proper method? </p>