I have the below dataframe:
| col1 | col2 | col3 |
|---|---|---|
| Device1 | A | true |
| Device1 | A | false |
| Device1 | C | false |
| Device1 | B | false |
I want to keep first two rows (where col2 value = A) where A is identified because col3 has a 'true' in row 1. In other words, for device 1, I want to keep all those rows where col2 has at least 1 value in col3 as 'true'. I expect the below result after the filter:
| col1 | col2 | col3 |
|---|---|---|
| Device1 | A | true |
| Device1 | A | false |