Editing Community Data Science Course (Spring 2023)/Week 3 coding challenges
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 29: | Line 29: | ||
* <code>girls</code> - A dictionary where the the keys are names of boys and the values are the number of infants born in 2021 who had that particular name. | * <code>girls</code> - A dictionary where the the keys are names of boys and the values are the number of infants born in 2021 who had that particular name. | ||
== #1 Your own name! == | == #1 Your own your name! == | ||
# Search for your own name. Are there both boys and girls that have your name? Is your name more popular for one group than for the other? (''Hint: don't use a for loop for this one.'') | # Search for your own name. Are there both boys and girls that have your name? Is your name more popular for one group than for the other? (''Hint: don't use a for loop for this one.'') | ||
Line 36: | Line 36: | ||
# How many boy names and girl names are described in the dataset? | # How many boy names and girl names are described in the dataset? | ||
# How many boys and girls | # How many boys and girls are described in the dataset? | ||
== #3 A sense of what's common == | == #3 A sense of what's common == | ||
# What is the most common name for each gender in | # What is the most common name for each gender in 2021? | ||
# What is the least common name? | # What is the least common name? | ||
# How often do the least common names occur? (Does your answer to this question bother you? Why?) | # How often do the least common names occur? (Does your answer to this question bother you? Why?) | ||
Line 48: | Line 48: | ||
# What is the longest name in the dataset? How many boys/girls names are exactly that length? What's going on? | # What is the longest name in the dataset? How many boys/girls names are exactly that length? What's going on? | ||
== #5 | == #5 Name twins == | ||
# | |||
# | # On average, how many "names twins" will a baby born in 2021 have (i.e., how many other children will share their name)? | ||
# Create a | # How many "name twins" will a boy have on average? How about a girl? | ||
# Now do the same for | # Create a list of names where 90% of the children with that name are listed as girls? And the same for boys? | ||
# Now create the same list but only include names that are given to at least 1000 children total. Why are the answers different? | |||
== #6 Write it out == | |||
# Create a tab separated values file that includes each letter of the alphabet (a-z), the number of unique names for that letter for all girls. Be sure to include a descriptive header columns! | |||
# Now do the same for boys (be sure to save it into a different file!) | |||
# Once you've done this, load up the two files into Google Sheets or Excel. | # Once you've done this, load up the two files into Google Sheets or Excel. | ||
# For every letter, be ready to tell if there are more boys names or girls names. | # For every letter, be ready to tell if there are more boys names or girls names. | ||
# Play around with graphing and see if you can build some instructive graph that shows us something. | # Play around with graphing and see if you can build some instructive graph that shows us something. | ||
'''Note:''' Obviously, you won't be able to include your Google Sheet result into your notebook. | '''Note:''' Obviously, you won't be able to include your Google Sheet result into your notebook. That's OK but just be ready to describe what you found! | ||
== #7 Something extra == | == #7 Something extra == | ||
# Discover at least one fact about the names that is not listed above | # Discover at least one fact about the names that is not listed above. | ||