title: Determining when a column value changes in pandas dataframe
body: <p>I am looking to write a quick script that will run through a csv file with two columns and provide me the rows in which the values in column B switch from one value to another: </p>
  
  <p>eg: </p>
  
  <p>dataframe:</p>
  
  <pre><code># |  A  |  B  
  --+-----+-----
  1 |  2  |  3
  2 |  3  |  3
  3 |  4  |  4
  4 |  5  |  4
  5 |  5  |  4
  </code></pre>
  
  <p>would tell me that the change happened between row 2 and row 3. I know how to get these values using for loops but I was hoping there was a more pythonic way of approaching this problem.</p>