I have a data frame having columns ( Name, a, b) and I want to create a columns name"mean" which would be mean of column a and b, but if mean of any two-row is same then whosever sum value is more should decrease by 0.1.
data frame 1
Name Sum a b mean
0 hamm 34 2 2 2
1 jam 54 1 1 --> 1
2 tan 36 3 1 2
3 pan 39 4 4 4
as we see now row 0 and 2 have the same mean value, so now whosever sum value is more should decrease by 0.1
Here, in this case, its row no 2 should have value 2- 0.1 = 1.9
Final Result
Name Sum a b mean
0 hamm 34 2 2 2
1 jam 54 1 1 1
2 tan 36 3 1 1.9
3 pan 39 4 4 4