Existing Dataframe :
ID Activity Action No. Status
A1 register 1 in
A1 fill form 2 in
A2 Payment Done 3 success
A2 fill form 2 in
B1 fill form 1 in
B1 Payment Done 2 success
B1 Process_drop 3 in
B1 fill form 1 in
Expected Dataframe :
ID Activity Action No. Status
A1 register 1 in
A1 fill form 2 in
A2 Payment Done 3 success
B1 Payment Done 2 success
Need to drop the remaining rows for each ID , once Activity == Payment Done and Status == success for that particular ID.( i.e. further rows needs to be removed once the condition is achieved)
i approached by grouping the ID and applying the conditions on the columns , but not sure about dropping the rows