title: Subtracting numpy arrays of different shape efficiently
body: <p>Using the excellent broadcasting rules of numpy you can subtract a shape (3,) array <code>v</code> from a shape (5,3) array <code>X</code> with </p>
  
  <pre><code>X - v
  </code></pre>
  
  <p>The result is a shape (5,3) array in which each row <code>i</code> is the difference <code>X[i] - v</code>.</p>
  
  <p>Is there a way to subtract a shape (n,3) array <code>w</code> from <code>X</code> so that each row of <code>w</code> is subtracted form the whole array <code>X</code> without explicitly using a loop? </p>