title: Is there any way to use itertools groupby to remove adjacent duplicating items in a list, but keep the original index?
body: <p>For example, if I have a list <code>[1,2,2,3,2,2,1]</code>, I would like to return <code>[1,2,3,2,1]</code>with index (0,1,3,4,6). </p>
  
  <p>I'm not familiar with groupby, I learned how to eliminate adjacent duplicate items, but it is possible to somehow also extract index with groupby()? Thank you. </p>