Pandas Filtering based on the length of the same kind variables in a column
Good answer by Juho. Another option is a groupby-filter:
df.groupby('id').filter(lambda group: len(group) &gt; 3)

#    samples id
# 1        2  b
# 2        3  c
# 3        4  b
# 4        5  b
# 5        6  b
# 6        7  c
# 7        8  c
# 8        9  c

To match your output order exactly, add a descending id sort: .sort_values('id', ascending=False)