0
$\begingroup$

I have a dataframe ,that looks like this

  | **site**  |  **Active**|

0 |: deals| Active:| 1 |: deals | InActive:| 2 | : deals | Active:| 3 |:discount | InActive:| 4 |:discount| Active:| i don't want to drop the duplicate items, but i want to change the Active columns value based on Site column,for example Active has to change inactive based on duplicate item in site column,Inactive also have to change based on number of duplicate items present,last duplicate item has to Active, other than that Inactive, If it is already inactive it also have to change

Expected

   site    Active

0 deals InActive 1 deals InActive 2 deals Active 3 discount InActive 4 discount Active

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.