I am struggling to drop rows that do not contain certain data. For example, I want my dataset to only predict between 'Male' and 'Female' so I need to drop everything with the 'Gender' column that is not equal to those two choices. How would I go about doing this?
I've tried:
df.drop(df['GENDER'] != 'Male' & 'Female')
I honestly have tried more code that I can type out so any help would be great. All of the pandas documentation I have read only shows how to remove certain values but not how to remove everything but certain values.
Thanks in advance!