Intro to Programming and Data Science (Summer 2020)/Day 4 Coding Challenges: Difference between revisions

From CommunityData
Line 4: Line 4:




== Baby Names ==
== Python for Everybody ==
Using the baby names data from [[Intro_to_Programming_and_Data_Science_(Summer_2020)/Day_3_Coding_Challenges|The day 3 challenges]]:
 
# Get the ratio of names that start with each letter.
Chapter 7:
#* Do this for boys and girls.
* Exercise 1
#* '''Hint''' First line of output should be something like:
* Exercise 2
#*: <pre>a: boys: 0.1002914920750592 girls: 0.17587602795796703</pre>
* Exercise 3
# Are girls or boys more likely to have a name that is used by both genders?
 
# Figure out how to change the ssadata.py file so that it loads births from 2017 instead of 2018.
=== Wordplay Level 2 ===
 
* For every letter, print the word that uses that character the most. Hint: use two nested for loops. First one is   
    for letter in 'abcdefghijklmnopqrstuvwxyz':
        # do something
* Find the longest string where no character appears more than 1 time. (Hint: look up counters)
* Use Python to find one other interesting fact about the data set. Examples (that you can't use) might be:
** One of the words that is tied for the most vowels is aquifoliaceous
** The word with the highest consonant to vowel ratio is sulphhydryls


== Above and beyond ==
== Above and beyond ==
# Figure out how to load two years of birth data simultaneously and compare them (e.g., identify the top 20 names from 2017 and figure out how many more/fewer people were named those names in 2018).
# Figure out how to load two years of birth data simultaneously and compare them (e.g., identify the top 20 names from 2017 and figure out how many more/fewer people were named those names in 2018).
# Visualize some of the differences (probably in Excel)
# Visualize some of the differences (probably in Excel)

Revision as of 21:12, 19 May 2020

Python for Everybody

Chapter 7: Exercises 1, 2, 3


Python for Everybody

Chapter 7:

  • Exercise 1
  • Exercise 2
  • Exercise 3

Wordplay Level 2

  • For every letter, print the word that uses that character the most. Hint: use two nested for loops. First one is
   for letter in 'abcdefghijklmnopqrstuvwxyz':
       # do something
  • Find the longest string where no character appears more than 1 time. (Hint: look up counters)
  • Use Python to find one other interesting fact about the data set. Examples (that you can't use) might be:
    • One of the words that is tied for the most vowels is aquifoliaceous
    • The word with the highest consonant to vowel ratio is sulphhydryls

Above and beyond

  1. Figure out how to load two years of birth data simultaneously and compare them (e.g., identify the top 20 names from 2017 and figure out how many more/fewer people were named those names in 2018).
  2. Visualize some of the differences (probably in Excel)