I need to drop duplicate rows in my DataFrame only if the number of duplicates is less than x (e.g. 3)
(if more than 3 duplicates, keep them !)

Sample: 

where `count` is number of duplicates and duplicates are in col `data`

```
data | count
-------------
a    | 1
b    | 2
b    | 2
c    | 1
d    | 3
d    | 3
d    | 3

```

Desired result:

```
data | count
-------------
a    | 1
b    | 1
c    | 1
d    | 3
d    | 3
d    | 3

```

How can i achieve this? Thanks in advance.