I have a dataset with columns "Rate","value1","value2". I want to generate new columns each time the rate changes. Whenever the rate changes the values will be populated from first row. I have attached an image file for the reference. I want to generate "newvalue1", "newvalue2", "newvalue3"
Rate value1 value2
0 2 5 1
1 2 3 6
2 2 5 0
3 2 3 3
4 2 6 6
5 3 3 1
6 3 1 4
7 3 9 7
8 4 6 8
9 4 0 4
10 4 4 2
11 4 6 7
12 5 7 9
13 5 8 0