title: Pandas groupby change in value of a column
body: <p>I have a dataframe called <code>merged</code> that looks like this. The index is <code>placa_encoded</code>.</p>
  <pre><code>placa_encoded   codcet          break 
      
  561.0           490101113       False
  561.0           480481112       False
  660.0           400081122       False
  660.0           420121123       True
  660.0           420141122       False
  660.0           420151122       False
  660.0           420171122       False
  660.0           420171113       True
  660.0           420161112       False
  660.0           420151112       False
  660.0           420121112       False
  660.0           420111112       False
  ...
  </code></pre>
  <p>I'm looking for a dataframe that looks like this, chunked into groups indexed by each <code>placa_encoded</code> and at each point with <code>break=True</code> (aside from the very first group obviously) such that</p>
  <pre><code>placa_encoded   codcet          break 
  
  [561.0] 
  561.0           490101113       False
  561.0           480481112       False
  
  [660.0] 
  660.0           400081122       False
  
  660.0           420121123       True
  660.0           420141122       False
  660.0           420151122       False
  660.0           420171122       False
  
  660.0           420171113       True
  660.0           420161112       False
  660.0           420151112       False
  660.0           420121112       False
  660.0           420111112       False
  ...
  </code></pre>
  <p>I've tried something like this so far, inspired by <a href="https://stackoverflow.com/questions/67108324/pandas-how-to-group-on-column-change">this</a> answer, but it has not worked the way I want and instead grouped into buckets of <code>True</code> and <code>False</code> instead for each <code>placa_encoded</code>.</p>
  <pre><code>merged['ne'] = merged['break'].ne(merged['break'].shift()).cumsum()
  merged.groupby(['placa_encoded', merged['ne']], sort=False)
  </code></pre>