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 18: | Line 18: | ||
* Open the file <code>BabyNames.ipynb</code> as a Jupyter notebook and run the first cell to make sure that it works. | * Open the file <code>BabyNames.ipynb</code> as a Jupyter notebook and run the first cell to make sure that it works. | ||
You'll be playing with data from the list of all baby names in the US (used more than five times in a year) from the last several years: | |||
# Right click the following file, click "Save Target as..." or "Save link as...", and save it to your Desktop directory: http://jtmorgan.net/ds4ux/week3/babynames.zip | |||
# The ".zip" extension on the above file indicates that it is a compressed Zip archive. We need to "extract" its contents. To do this, click on "Start", then "Computer", and navigate to your Desktop directory. Find babynames.zip on your Desktop and double-click on it to "unzip" it. That will create a folder called babynames containing several files. | |||
Each of these files begins with this line: | |||
import ssadata | |||
This imports the ssadata module which is a special Python module we created for this project that includes only two things: | This imports the ssadata module which is a special Python module we created for this project that includes only two things: | ||
Line 29: | Line 33: | ||
* <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. | ||
== | == Challenges == | ||
# Search for your own name. Are there both boys and girls that have your name? Is | # Search for your own name. Are there both boys and girls that have your name? Is it more popular for one group than for the other? (''Hint: don't use a for loop for this one.'') | ||
# What is the most common name for each gender? | |||
# What is the least common name? | |||
# What is the most common name for each gender | |||
# 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?) | ||
# Are there more boys names or girls names? | |||
## What about boys names and girls names that start with "a"? | |||
## For every letter, tell if there are more boys names or girls names. | |||
# What is the longest name in the dataset? | |||
# How many total boys and girls are described in the dataset? | |||
# How many boys names are also girls names? How many girls names are also boys names? | |||
# | # What is the most popular girls name that is also a boys name? | ||
# Discover at least one fact about the names that is not listed above. | |||
# ''Challenge'' Make a plot (in Excel) the number of people who share a name with n other people in the data set, where n is 4 to 19. | |||
# | |||
# For every letter, | |||
# | |||
# | |||
# Discover at least one fact about the names that is not listed above | |||