In a Python data frame, how do you extract a specific element in one column after finding the row that element belongs to? [duplicate]

What I'm trying to do is create a function that returns the frequency or count of a name input into the function. For example, if I inputted 'Olivia' into my get_frequency(name) function I would want 19674 returned.

Dataframe of baby names from 2014. With columns: Name, Sex, and Count

My attempt at creating a function that returns the count of name in 'Name'

Read more here:

Content Attribution

This content was originally published by Ricardo Gomez at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: