title: How to iterate over pandas dataframe and create new column
body: <p>I have a pandas dataframe that has 2 columns. I want to loop through it's rows and based on a string from column 2 I would like to add a string in a newly created 3th column. I tried:</p>
  
  <pre><code>for i in df.index:
      if df.ix[i]['Column2']==variable1:
          df['Column3'] = variable2
      elif df.ix[i]['Column2']==variable3:
          df['Column3'] = variable4
  
  print(df)
  </code></pre>
  
  <p>But the resulting dataframe has in column 3 only Variable2.</p>
  
  <p>Any ideas how else I could do this?</p>