title: Numpy averaging with multi-dimensional weights along an axis
body: <p>I have a numpy array, <code>a</code>, <code>a.shape=(48,90,144)</code>. I want to take the weighted average of <code>a</code> along the first axis using the weights in array <code>b</code>, <code>b.shape=(90,144)</code>. So the output should be a numpy array of shape <code>(48,)</code>.</p>
  
  <p>I know this can be done with a list comprehension: </p>
  
  <pre><code>np.array([np.average(a[i], weights=b) for i in range(48)])
  </code></pre>
  
  <p>But I'd like to avoid having to convert from a list back to a numpy array. </p>
  
  <p>Can anyone help? I'm sure this is possible using numpy functions and slicing, but I'm stuck. Thanks!</p>