How can I remove values from a column in pandas.DataFrame
, that occurs rarely, i.e. with a low frequency? Example:
In [4]: df[col_1].value_counts()
Out[4]: 0 189096
1 110500
2 77218
3 61372
...
2065 1
2067 1
1569 1
dtype: int64
So, my question is: how to remove values like 2065, 2067, 1569
and others? And how can I do this for ALL columns, that contain .value_counts()
like this?
UPDATE: About 'low' I mean values like 2065
. This value occurs in col_1
1 (one) times and I want to remove values like this.