I would like to count how many Male and female who answer (ex. Biking / Cycling).
Below is the sample data:
Data Science Stack Exchange is a question and answer site for Data science professionals, Machine Learning specialists, and those interested in learning more about the field. It only takes a minute to sign up.
Sign up to join this communityThe Series.str.contains method will return True
for str elements in a series that contain a substring. So df[df.OABP.str.contains('Biking / Cycling')].groupby('Gender').size()
should give you the answer.