Existing dataframe :
ID Activity Action No.
A1 register 1
A1 fill form 2
A2 Payment Done 3
A2 fill form 2
B1 fill form 1
B1 Payment Done 2
B1 Process_drop 3
B1 fill form 1
Expected Dataframe :
ID Activity Action No.
A1 register 1
A1 fill form 2
A2 Payment Done 3
B1 fill form 1
B1 Payment Done 2
when ID perform Payment Activity the other rows after the payment done need to be dropped. i tried groupby on ID & applied lambda function on Activity , but stuck with how to proceed