My data frame -
| Col_A | Col_B |
|---|---|
| 101 | 1 |
| 101 | 2 |
| 101 | 3 |
| 101 | 4 |
| 101 | 1 |
| 101 | 2 |
| 102 | 1 |
| 102 | 2 |
| 102 | 3 |
| 102 | 2 |
I want to drop the rows after the first occurrence of "3" from Col_B w.r.t Col_A.
Desired output -
| Col_A | Col_B |
|---|---|
| 101 | 1 |
| 101 | 2 |
| 101 | 3 |
| 102 | 1 |
| 102 | 2 |
| 102 | 3 |
How can I achieve this?