I have a DataFrame that looks something like this: C1 C2 10 10 20 10 30 16 5 23 6 23 8 10 4 10 2 10 I would like to calculate the mean value in column C1 depending on the values in column C2. The mean value is to be calculated over all values in column C1 until the value in column C2 changes again. The result table should look like this: C1 C2 15 10 30 16 5.5 23 4.67 10 Continue reading...