I hope you're doing well. I want to drop duplicates rows based on some conditions.
For example :
    A   B   C   D   E
0   foo 2   3   4   100
1   foo 2   3   1   3
2   foo 2   3   5   nan
3   bar 1   2   8   nan
4   bar 1   2   1   nan
The result should be
    A   B   C   D   E
0   foo 2   3   4   100
1   foo 2   3   1   3
2   bar 1   2   nan nan
So we have duplicated rows (based on columns A,B, and C), first we check the value in column E if it's nan we drop the row but if all values in column E are nan (like the example of row 3 and 4 concerning the name 'bar'), we should keep one row and set the value in column D as nan.
Thanks in advance.