title: Is there a numpy equivalent to pandas.apply?
body: <p>I have a call which adds some random values to a pandas Series:</p>
  
  <pre><code>series = series.apply(lambda x: int(math.ceil(x + x * rand_value(range))))
  </code></pre>
  
  <p>For performance reasons I can't use the pandas.Series anymore and have to use numpy arrays instead.</p>
  
  <p>Imagine my 1D-array data is stored in <code>a</code>, how would I transform the call from above to numpy? I read about <code>np.vectorize</code> but I don't understand how I would use this with my lambda and self-made function to call.<br>
  My Idea:</p>
  
  <pre><code>func = np.vectorize(lambda x: int(math.ceil(x + x * rand_value(range))))
  a = func(a)
  </code></pre>
  
  <p>At first glance it looks like that both calls result in the same output, but I am not sure about that. Could you confirm this?<br>
  And is there a better way, than using <code>np.vectorize()</code>?</p>
  
  <p>Edit: rand_value(range) is defined like that:</p>
  
  <pre><code>def rand_value(range):
  
      # create value between [-1; 1)
      rand = np.random.rand()*2.0 - 1.0; 
  
      rand = (rand * float(range)) / 100.0
  
      return rand
  </code></pre>
  
  <p>So I can't use <code>np.ceil</code>, because then my function will only get called once (?) and have always the same rand values, what I need, is that for every value in my array the function gets called.</p>