I have a sorted dataframe with an ID, and a value column, which looks like:
ID value A 10 A 10 A 10 B 15 B 15 C 10 C 10 ...