I have a DF
***********************
Product Rate Imputed_rate min_rate
1 0 10 5
2 0 4 7
3 0 34 2
4 0 3 8
***************************
I want to replace the row when Rate=0 ; with the 'min_rate' only if 'Imputed_rate'<min_rate
What is the best way to do this?
Desired Output:
Product Rate Imputed_rate min_rate
1 0 10 5
2 7 4 7
3 0 34 2
4 8 3 8
***************************