I have a dataframe which has a lot of duplicates. I found a lot of solutions to find the number of duplicates, but not the way I wanted to. Is there a way to count the duplicates in a new column if it has less than or equal to 2 duplicates?

The dataframe looks like this:

```
    NAME
0  Peter
1  Peter
2  Peter
3   Jack
4   Jack
5   Luke

```

But I want it to look like this:

```
    NAME  Count
0  Peter      0
1  Peter      0
2  Peter      0
3   Jack      1
4   Jack      1
5   Luke      1

```

And then filter it (remove rows) such that I only have a dataframe where `Count` is `1`.

```
    NAME  Count
0   Jack      1
1   Jack      1
2   Luke      1

```

If there is a simpler way to remove duplicates then I am happy to hear about it.