This is how my dataset looks:dataset sample
I am trying to remove player entries that has less than 5 years (5 entries of the same name) from the whole dataset. So in the sample snapshot, A.C. Green rows should be left untouched.
I have tried this line of code from a similar question (How can I remove rows where frequency of the value is less than 5? Python, Pandas):
n = playersData[['Player']]
playersData[n.replace(n.apply(pd.Series.value_counts)).gt(5).all(1)]
but the df.shape shows there is no decrease in rows.