title: How to write python script to read two excel worksheets and delete any repeats in one if both have values?
body: <p>I have 2 worksheets in excel. They both contain 3 columns a,b and c. I need to delete any row in worksheet 1 if the data items for columns a,b,c are the same between the two worksheets. How would I do this using the Pandas python library?</p>
  
  <pre><code>import pandas as pd
  ws1 = pd.read_excel(pathname/worksheet1.xlsx)
  ws2 = pd.read_excel(pathname/worksheet2.xlsx) 
  </code></pre>
  
  <p>Basically <code>worksheet1</code> looks something like this (dummy numbers assume they're different in actual data):</p>
  
  <pre><code>a   b   c   d   e   f
  1   2   3   4   4   4
  1   2   3   4   4   4
  1   2   3   4   4   4
  1   2   3   4   4   4
  1   2   3   4   4   4
  </code></pre>
  
  <p><code>worksheet2</code> looks something like this:</p>
  
  <pre><code>a   b   f   d   e   c
  1   2   4   4   4   3
  1   2   4   4   4   3
  1   2   4   4   4   3
  1   2   4   4   4   3
  1   2   4   4   4   3
  </code></pre>
  
  <p>I have to check columns a,b and c in <code>worksheet1</code> and if the same data shows up in <code>worksheet2</code>, I would delete that row in <code>worksheet1</code>. </p>
  
  <p>For example, in <code>worksheet1</code> the values 1,2 and 3 are returned for columns a,b and c. I need to check if 1,2 and 3 show up in columns a,b and c in <code>worksheet2</code> (located differently). If they do show up in <code>worksheet2</code>, I need to delete the row in <code>worksheet1</code> with the values 1,2 and 3. </p>