I have a DataFrame, where rows are 'grouped' by the third column (rows in one 'group' have the same value at the third column):
c1 c2 c3
0 b 1
1 r 1
2 f 2
3 x 2
4 n 2
5 r 3
6 f 3
But the values in the second column have a wrong order. I need to reverse rows in each 'group', so DataFrame should look like this:
c1 c2 c3
0 r 1
1 b 1
2 n 2
3 x 2
4 f 2
5 f 3
6 r 3
Is there an effective way to transform the first DataFrame to the second one with pandas?
UPD: Updated with more clear example. The values should be exactly reversed, not just became located in the alphabetical order.