title: Pandas get elements until value changes
body: <p>I'm working with a large dataframe with Pandas, where I need to have all the elements until one value changes. For example:</p>
  
  <pre><code>e1    e2
  1     15
  1     16
  1     17
  0     14
  0     13
  0     14
  1     16
  1     15
  </code></pre>
  
  <p>Here I want first three elements, then the next three and after that the last two.
  I was wondering if there is a method of Pandas for this.</p>