title: Python: Vectorizing evaluations of arrays of lambda functions
body: <p>How would you vectorize the evaluation of arrays of lambda functions?</p>
  
  <p>Here's an example to understand what I'm talking about. (And even though I'm using <code>numpy</code> arrays, I'm not limiting myself to only using <code>numpy</code>.)</p>
  
  <p>Let's say I have the following <code>numpy</code> arrays. </p>
  
  <pre><code>array1 = np.array(["hello", 9])
  array2 = np.array([lambda s: s == "hello", lambda num: num &lt; 10])
  </code></pre>
  
  <p>(You could store these kinds of objects in <code>numpy</code> without throwing an error, believe it or not.) What I want is something akin to the following.</p>
  
  <pre><code>array2 * array1 
  # Return np.array([True, True]). PS: An explanation of how to `AND` all of 
  # booleans together quickly would be nice too.
  </code></pre>
  
  <p>Of course, this seems impractical for arrays of size 2, but for arrays of arbitrary sizes, I'll assume this would yield a performance boost because of all of the low level optimizations.</p>
  
  <p>So, anyone know how to write this weird kind of python code?</p>