title: Is there a way to apply a numpy function that takes two 1d arrays as arguments on each row of two 2d arrays together?
body: <p>I am trying to run something like:</p>
  <pre><code> np.bincount(array1, weights = array2, minlength=7)
  </code></pre>
  <p>where both <code>array1</code> and <code>array2</code> are 2d n numpy arrays of shape (m,n). My desired goal is that <code>np.bincount()</code> is run n times with each row of array1 and array2</p>
  <p>I have tried using <a href="https://numpy.org/doc/stable/reference/generated/numpy.apply_along_axis.html" rel="nofollow noreferrer">np.apply_along_axis()</a> but as far as  I can tell this only allows for the function to be run on each row of array1 without using each row of array2 as arguments for <code>np.bincount</code>. I was hoping to find a way to do this cleanly with a numpy function rather than iteration as this is a performance critical function but so far can't find another way.</p>
  <p>For Example, given these arrays:</p>
  <pre><code>array1 = [[1,2,3],[4,5,6]]
  array2  = [[7,8,9],[10,11,12]]
  </code></pre>
  <p>I would want to compute:</p>
  <pre><code>[np.bincounts([1,2,3], weights = [7,8,9],minlength=7),  np.bincounts([4,5,6], weights = [10,11,12], minlength=7)]
  </code></pre>