title: Difference of two columns if condition is met
body: <p>To get the difference between two columns of a pandas dataframe when specifying a condition I'm currently using the following code. For example, to get difference between column <code>A</code> and <code>B</code> for the rows where <code>A &gt; B</code>:</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame({'A' : [4,5,6,7], 'B' : [1,2,10,11]}); df
     A   B
  0  4   1
  1  5   2
  2  6  10
  3  7  11
  
  df2 = df.loc[df.A &gt; df.B]
  df2.A - df2.B
  0    3
  1    3
  </code></pre>
  
  <p>Is there a way to "pipe" this instead of creating the temporary dataframe <code>df2</code> above?</p>