You and your spouse decided to let the internet name your next child. You've asked the great people of the web to submit their favorite names, and you've compiled their submissions into a Series called babynames
.
Determine how many people voted for the names 'Chad', 'Ruger', and 'Zeltron'.
Solution¶
Explanation
The trick here is to use the Series value_counts()
method to get the count of each unique element in the Series.
This results in another Series, so we can chain it with .loc
passing in a list of the indices we want to retrieve.