How to count words in a dataframe?
I would like to count how many Male and female who answer (ex. Biking / Cycling).
Below is the sample data:
I would like to count how many Male and female who answer (ex. Biking / Cycling).
Below is the sample data:
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.
Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.