title: If logic in Pandas, Python 3
body: <p>I've got a Pandas Dataframe from which I want to compare two columns and create a new column with a calculation based off the result of the comparison. Logic would be the following:</p>
  
  <pre><code>If df['column1']&gt;df['column2'] :
     df['New column']=(df['column1']+df['column2'])
  else :
     df['New column']=(df['column1']+df['column2']+1)
  </code></pre>
  
  <p>I am fairly new to Pandas and Python so I'm sure I'm getting the structure wrong. Could you guys point me in the right direction?</p>