title: numpy vs list comprehension, which is faster?
body: <p>I ran a simple speed test comparing numpy and python list comprehension, and apparently list comprehension was faster. Is that correct?</p>
  
  <pre><code>import sys, numpy
  from datetime import datetime
  
  def numpysum(n):
      a = numpy.arange(n) ** 2
      b = numpy.arange(n) ** 3
      return a + b
  
  def pythonsum(n):
      a = [i ** 2 for i in range(n)]
      b = [i ** 3 for i in range(n)]
      return [a[i] + b[i] for i in range(n)]
  
  size = 10
  start = datetime.now()
  c1 = pythonsum(size)
  delta1 = datetime.now() - start
  
  start = datetime.now()
  c2 = numpysum(size)
  delta2 = datetime.now() - start
  
  print c1
  print c2
  
  print delta1
  print delta2
  </code></pre>