Skip to content
Prev 313893 / 398503 Next

Set a zero at minimum row by group

Just noticed that I used a modified copy of df. It should be
ID T x x_new
1  1 1 1     0
2  1 2 1     1
3  1 3 1     1
4  2 1 1     0
5  2 4 1     1
6  3 3 1     0
7  3 5 1     1
8  3 6 1     1
9  3 8 1     1
-------
David