title: Better way to do a sum of a function including two arrays between limits
body: <p>I am trying to run a sum between 1 and k (which is 850 incidentally) the sum is the following; </p>
  
  <pre><code>I = sum( (e*I(l_i)*l_i/hc)*(l_i+1 - l_i ) 
  </code></pre>
  
  <p>where e, h and c are constants and l and I are arrays of equal length more than length k. The sum is over i which is the index of each array, running between 1 and k. </p>
  
  <p>This is what I have so far; </p>
  
  <pre><code>import numpy as np
  import scipy 
  import scipy.constants 
  
  e = scipy.constants.e
  h = scipy.constants.h
  c = scipy.constants.c
  
  I = []
  
  for i in range(1,k):
      I_temp = (e * Flux[i] * WaveL[i])/(h*c) * (WaveL[i+1]-WaveL[i])
      I.append(I_temp)
  
  I_max = sum(I)
  </code></pre>
  
  <p>This works, but is there a quicker, more natural way to do this? </p>