I have a DataFrame with the column 'code' with rows duplicated and a column year: | code | year | |---------------------|------------------| | AAAAAAA | 2019 | | AAAAAAA | 2019 | | AAAAAAA | 2020 | | BBBBBBBBB | 2019 | | BBBBBBBBB | 2019 | | BBBBBBBBB | 2020 | | CCCCCCCCCC | 2019 | | CCCCCCCCCC | 2019 | | CCCCCCCCCC | 2020 | | DDDDDDDDDDD | 2020 | I would drop the rows duplicated on the column 'code' if year is equal to '2019' beacause I don't want to have duplicate rows 'code' through the same year (for example 2019). I also want the same opeartion with the 2020 year (drop the rows duplicated in the column 'code' if the column 'year' is 2020) I would like to have both conditions in the same code.
I tried to check other questions similar to this one, but I found nothing that can satisfy my request.
All solutions, will be appreciated.