I have this dataset:
df = pd.DataFrame({'scientist':["Wendelaar Bonga"," Sjoerd E.", "Grätzel"," Michael", "Willett", "Walter C.",
"Kessler", "Ronald C.", "Witten, Edward", "Wang, Zhong Lin"],
'SubjectField': ["Biomedical Engineering", "Inorganic & Nuclear Chemistry",
"Organic Chemistry", "Biomedical Engineering", "Developmental Biology",
"Mechanical Engineering & Transports", "Biomedical Engineering", "Microbiology",
"Cardiovascular System & Hematology", "Biomedical Engineering"]})
and I want to count the number of scientists in each subject field and remove subject fields that have less than 2 scientists from my data.
x= df.groupby('SubjectField')['scientist'].count()
ans = x[x > 2]
this is my code but I don't know how to remove the mentioned rows: