I've checked the docs (https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.eq.html)
I'm thinking something like below where I can use and re.I to ingnore case or use any other flag for that matter.
df.column.eq('Male').sum()
I've checked the docs (https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.eq.html)
I'm thinking something like below where I can use and re.I to ingnore case or use any other flag for that matter.
df.column.eq('Male').sum()
You can use the Series.str.contains function with case=False argument, ^Male$ as regex pattern and the regex=True argument:
df['column'].str.contains('^Male$', case=False, regex=True).sum()
See the Series.str.contains documentation.