I'm new here and into programming ... I'm doing a small project and have a question.
How can I count the number of entries in a single row / column? As you can see in the photo, Female --> 1; female, female --> 2 etc.
I'm new here and into programming ... I'm doing a small project and have a question.
How can I count the number of entries in a single row / column? As you can see in the photo, Female --> 1; female, female --> 2 etc.
Using pandas.Series.str.count:
df_cf["count"] = df_cf["borrower_genders"].str.count("female")