Existing Dataframe :
UserId Activity_date Status
A 27-01-2022 initiated
A 27-01-2022 In_process
A 27-01-2022 Success
A 28-01-2022 initiated
A 28-01-2022 Completed
A 30-01-2022 initiated
A 30-01-2022 failed
B 26-01-2022 initiated
B 26-01-2022 Completed
B 26-01-2022 Success
B 27-01-2022 initiated
Need to drop those entries where Success or Completed does not appear for the Same Activity Date. as in case of UserId A , Success status appears on the 27-01-2022 and Completed status appears on 28-01-2022 , so the new dataframe should all the rows for the Activity date 27-01-2022 and 28-01-2022
Expected Dataframe :
UserId Activity_date Status
A 27-01-2022 initiated
A 27-01-2022 In_process
A 27-01-2022 Success
A 28-01-2022 initiated
A 28-01-2022 Completed
B 26-01-2022 initiated
B 26-01-2022 Completed
B 26-01-2022 Success
i approached it with grouping by the UserId and Activity_date and checking the row for 'Success' or 'Completed' status , but stucked with dropping part.