title: Python - evaluate a function with for
body: <p>I want to evaluate discrete points of a function for each value of a given array (named <code>wl</code>). So far I have:</p>
  
  <pre><code>from pylab import *
  import numpy
  
  #wl is a defined list
  a=1
  b=3934.3
  c=0.2885
  for x in (wl):
      G[x]=a*exp(-(wl(x)-b)^2/c^2)
  </code></pre>
  
  <p>but I get the error <code>TypeError: 'numpy.ndarray' object is not callable</code>. What I need is a second list named <code>G</code> whose values correspond to the evaluated function at each value in the list <code>wl</code>.</p>
  
  <p>What does this error mean? Should I somehow define <code>G</code> before?</p>
  
  <p>Thanks.</p>