I\'ve tried to split my dataframe to groups
df = pd.DataFrame({\'A\' : [\'foo\', \'bar\', \'foo\', \'bar\', \'foo\', \'bar\', \'foo\',
Something like this would work:
for group, index in grouped.indices.iteritems(): grouped.indices[group] = range(0, len(index))
You could probably make it less verbose if you wanted to.