My Data frame has several columns,
Id | Name | age |
---|---|---|
1 | John Camp | 25 |
2 | Richard | 35 |
3 | John Randell | 29 |
4 | John Cameron | 26 |
5 | John Jacob | 28 |
6 | Oliver | 24 |
7 | Eugene | 22 |
8 | John Camp | 21 |
9 | John Clark | 29 |
10 | John Rick | 21 |
Intended Output:
Id | Name | age |
---|---|---|
1 | John Camp | 25 |
2 | Richard | 35 |
4 | John Cameron | 26 |
6 | Oliver | 24 |
7 | Eugene | 27 |
8 | John Camp | 25 |
10 | John Rick | 21 |
I need to delete those names starting with John who are not (Camp,Cameron,Rick) while keeping the rest of the names.
- John Camp
- John Cameron
- John Rick
I want to remove only those Johns who aren't in the given three names above, while keeping other names.
Can someone help me with this?