Apologies if this may be a duplicated question, I have not had any luck solving my issue with guidance of semi-similar posts.
I have a df with columns ID and current_stage, using Python
I want to go through and find the duplicated values in ID, and of those that are duplicated check to see if they have a 1 or 2 for the current stage. if they only have 1 or 2, then I only need one record of that ID. If there is a 3 or 4 in an instance of a duplicated ID, I want to keep all of the records of that duplicated ID.
I appreciate any help the gods of stack overflow have!
Thank you