I have a dataframe looking as:
Day State Element
1 2020-04-01 0 A
2 2020-04-01 0 B
3 2020-04-01 0 C
4 2020-04-01 1 C
I'd like to filter the duplicated rows, but only based on the columns Day and Element, and keep the rows where State is 1. My expected output is:
Day State Element
1 2020-04-01 0 A
2 2020-04-01 0 B
3 2020-04-01 1 C
I've tried with drop_duplicates and distinct but there not working properly.