title: python compare 2 columns and write a 4th column with values from 1st column if column 3 matches column 2
body: <p>I have 3 columns in an excel file. I would like to compare values in col 3 with values in col2. If the value exist in col2, write the value of col1 to col4. if the value is not in col2, write NA in col 4. col3 may sometimes be empty value in which case nothing to compare.</p>
  
  <p>Example:
  Excel file  </p>
  
  <pre><code>col1    col2    col3
  a2      2        4
  1d      3        2
  cc      5        3
  12      4        1
  </code></pre>
  
  <p>Expected result:</p>
  
  <pre><code>col1    col2    col3    col4
  a2      2        4       12
  1d      3        2       a2
  cc      5        3       1d
  12      4        1       NA
  </code></pre>
  
  <p>Still a work in progress. A pointer will be very helpful please.</p>