title: pandas DataFrame delete contiguous duplicates
body: <p>How can I remove contiguous/consecutive/adjacent duplicates in a DataFrame?</p>
  
  <p>I'm manipulating data in CSV format, am sorting by date, then by an identifying number. The identifying number can appear on different days, but I only want to delete the daily duplicates. drop_duplicates leaves one unique instance, but then deletes that identifier on all other days. I've tried <a href="https://stackoverflow.com/questions/19463985/pandas-drop-consecutive-duplicates">this</a>, but get the error:</p>
  
  <pre><code>localhost:~/Desktop/Public$ python3 test.py 
  Traceback (most recent call last):
    File "test.py", line 31, in &lt;module&gt;
      df2.loc[df2.shift(1) != df2]
    File "/usr/lib/python3/dist-packages/pandas/core/indexing.py", line 1028, in __getitem__
      return self._getitem_axis(key, axis=0)
    File "/usr/lib/python3/dist-packages/pandas/core/indexing.py", line 1148, in _getitem_axis
      raise ValueError('Cannot index with multidimensional key')
  ValueError: Cannot index with multidimensional key
  </code></pre>
  
  <h2>Edited original post to add:</h2>
  
  <p>I tried index_reset() to remove any multiindex. Here's a sample of the dataset:</p>
  
  <pre><code>,DATE,REC,NAME
  0,07/02/2009,682566,"Schmoe, Joe"
  1,07/02/2009,244828,"Doe, Joe"
  2,07/11/2009,325640,"Black, Joe"
  3,07/11/2009,544440,"Dirt, Joe"
  4,07/11/2009,544440,"Dirt, Joe"
  5,07/16/2009,200560,"White, Joe"
  6,07/16/2009,685370,"Purple, Joe"
  7,07/16/2009,685370,"Purple, Joe"
  8,07/16/2009,635400,"Red, Joe"
  9,07/16/2009,348562,"Blue, Joe
  </code></pre>