Keeping only categories that contain both female and male observations : <p>I'm working with a dataframe where a "job_title" column contains hundreds of titles, and a different column, "gender", specifies whether the person represented by the observation is male or female.</p>

<p>(I'm struggling to figure out) how to drop all rows such that the job title value isn't shared by both a male and a female?</p>

<p>In other words, I want to keep a row if and only if its "job_title" value is recorded for at least one other row which has the other "gender" value. If only males have a specific job title, I want to drop all the rows with that job title; if only females have a job title, I'm looking to drop all rows with that job title too.</p>
