title: how to use numpy.vectorize or numpy.frompyfunc
body: <p>[EDIT:I sort of brush this example up so I didn't clean up my code very well. My question is more on, how do I pass a subarray into a numpy.vectorize-d function, not specifically about this example.]</p>
  
  <p>I can't figure out how to use numpy.vectorize or numpy.frompyfunc to vectorize commands that takes an array as an argument. </p>
  
  <p>Let's think of this easy example (I understand this is a very basic example and I don't have to use numpy.vectorize at all. I am just asking for an example): </p>
  
  <pre><code>aa = [[1,2,3,4], [2,3,4,5], [5,6,7,8], [9,10,11,12]]
  bb = [[100,200,300,400], [100,200,300,400], [100,200,300,400], [100,200,300,400]]
  </code></pre>
  
  <p>And I want to vectorize a function that adds up the second element of each subarray of aa and bb. In this example I want to return an array of [202 203 206 210]</p>
  
  <p>But a code like this doesnt work:</p>
  
  <pre><code>def vec2(bsub, asub):
      return bsub[1] + asub[1]
  
  func2 = np.vectorize(vec2)
  func2( bb, aa )
  </code></pre>
  
  <p>Similar thing with numpy.frompyfunc has no luck.</p>
  
  <p>My question is, how do I past a list of subarrays into a numpy.vectorize-d function and let each subarray be the argument of the function? </p>