0

I have a dataframe with multiple columns for births of male and female babies, their names, frequency of the names, and ethnicity. I have to find the amount of distinct male and female names with each name been counted only once. Here's an example of the DataFrame:

birth_year  gender  ethnicity       first_name  frequency
2011        female  hispanic        rose        13
2011        female  black non hisp  marie       21
2011        female  hispanic        gianna      49
2011        male    white non hisp  michael     38
2011        female  hispanic        grace       36

I have no idea how to calculate this using pandas

Ric
  • 23
  • 4

0 Answers0