I got a dataframe similar to this:
Original
# | col_a | col_b | ..
1 | 100725 | No | ..
2 | 100726 | Yes | ..
3 | 100726 | No | ..
4 | 100726 | No | ..
5 | 100727 | Yes | ..
6 | 100728 | No | ..
7 | 100728 | Yes | ..
8 | 100728 | Yes | ..
9 | 100729 | No | ..
10 | 100729 | No | ..
Result
# | col_a | col_b | ..
1 | 100725 | No | ..
2 | 100726 | Yes | ..
5 | 100727 | Yes | ..
8 | 100728 | Yes | ..
9 | 100729 | No | ..
What I'm trying to achieve: as shown above, I want to create a new dataframe with only unique numbers inside col_a, but with a twist: In col_b I want to receive a Yes, regardless if all or just one row contains this value. Only if there are only No-Values I want to receive a No in the final dataframe.
Is there a clever way to achieve such a dataframe without creating a bunch of temporary columns for calculating.
Thanks for your help and have a great day!
finethen