title: Pandas subtract DataFrame column from lookup DataFrame column
body: <p>Given a dataframe <code>test</code> and another dataframe <code>lookup</code></p>
  <pre><code>test = pd.DataFrame( [['a',1],
                        ['a',2], 
                        ['b',9]], columns = ['id', 'n'])
  
  lookup_mins = pd.DataFrame( [['a',1], 
                               ['b',9], 
                               ['c',7]] , columns = ['id', 'n'])
  </code></pre>
  <p>trying to subtract each value <code>n</code> in <code>test</code> by the value <code>n</code> with matching <code>id</code> in <code>lookup_mins</code> using</p>
  <pre><code>s = lookup_mins.groupby(['id'])['n'].transform('min')
  test['n2'] = test['n'] - s
  </code></pre>
  <p>Expected result,</p>
  <pre><code>id n n2
  a  1 0
  a  2 1
  b  9 0
  </code></pre>
  <p>but getting instead</p>
  <pre><code>id n n2
  a  1 0
  a  2 -7
  b  9  9
  </code></pre>
  <p>How to subtract <code>test</code> and <code>lookup_mins</code> to get the expected result as stated above?</p>