0
$\begingroup$

I would like to count how many Male and female who answer (ex. Biking / Cycling).

Below is the sample data:

enter image description here

$\endgroup$

1 Answer 1

0
$\begingroup$

The 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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.