title: nested operations on two numpy arrays, one 2d and one 1d
body: <p>Say I have one 2d numpy array X with shape (3,3) and one numpy array Y with shape (3,) where</p>
  <pre><code>    X = np.array([[0,1,2],
                    [3,4,5],
                    [1,9,2]])
      Y = np.array([[1,0,1]])
  </code></pre>
  <p>How can I create a numpy array, Z for example, from multiplying X,Y element-wise and then summation row-wise?</p>
  <pre><code>   multiplying element-wise would yield: 0,0,2, 3,0,5, 1,0,2
     then, adding each row would yield:
     Z = np.array([2,8,3]) 
  </code></pre>
  <p>I have tried variations of</p>
  <pre><code>   Z = np.sum(X * Y) --&gt; adds all elements of entire array, not row-wise.
  </code></pre>
  <p>I know I can use a forloop but the dataset is very large and so I am trying to find a more efficient numpy-specific way to perform the operation. Is this possible?</p>