I have the following DF

```
Cod  Category  N
1    A         1 
1    A         2
1    A         3
1    B         1
1    B         2
1    B         3
1    B         4
1    B         5
2    D         1
3    Z         1
3    Z         2
3    Z         3
3    Z         4

```

I need to filter this DF to, when N > 3, then all values for the category should be retrieved. My expected output to simplify the example:

```
Cod  Category  N
1    B         1
1    B         2
1    B         3
1    B         4
1    B         5
3    Z         1
3    Z         2
3    Z         3
3    Z         4

```

How Can I Implement this type of filter? I tried to use window functions to generate another column with a Flag indicating to filter, but with no success.