title: Pandas: loop through rows and check if row is the same as previous row
body: <p>I have this dataframe:</p>
  <pre><code>data={'col1':[1,3,3,1,2,3,2,2]}
  df=pd.DataFrame(data,columns=['col1'])
  </code></pre>
  <p>I want to loop through it, and do something if a row as the same value as the last row.</p>
  <p>Something like this:</p>
  <pre><code>for row, index in df.iterrows():
      if row == previous row: # that's the line I'm looking for
          print(&quot;ok&quot;)
  </code></pre>