title: finding rows with one difference in DataFrame
body: <p>I have a data set were a number of rows are nearly identical, meaning they have the same values for all fields except column C. </p>
  
  <pre><code>    A    B         C     D ..... Z
  0    50  'Ohio'   'Rep'  3       45
  1    50  'Ohio'   'Dem'  3       45
  2    40  'Kansas' 'Dem'  34      1
  3    30  'Kansas' 'Dem'  45      2
  4    55  'Texas'  'Rep'  2       7
  ....
  38   55  'Texas'  'Dem'  2       7
  </code></pre>
  
  <p>I would like to identify all rows that are identical except for column C, but within column C I only want to to find combinations of 'Rep' and 'Dem'. So I don't want 2 identical rows with column C for instance being 'Rep' and 'Rep'.</p>
  
  <pre><code>     A    B         C   D ......Z
  0    50  'Ohio'   'Rep'  3       45
  1    50  'Ohio'   'Dem'  3       45
  4    55  'Texas'  'Rep'  2       7
  38   55  'Texas'  'Dem'  2       7
  </code></pre>
  
  <p>I have used the duplicated method on all columns (but C) and that provides all the rows that are identical. However, it does not lead to a duplication where each duplicated row with 'Rep' has exactly one duplicated row with 'Dem'. </p>