Skip to content

Instantly share code, notes, and snippets.

@mediagestalt
Last active June 22, 2023 19:11
Show Gist options
  • Save mediagestalt/78de91092f21ad8b279f0f07f961a2f2 to your computer and use it in GitHub Desktop.
Save mediagestalt/78de91092f21ad8b279f0f07f961a2f2 to your computer and use it in GitHub Desktop.
#
#
#
#
#
#
#
#
#
###########
# Line 14 in this Gist and line 14 in code block 6 in the notebook are the same. The '#' before the text means that the line is a comment, not live code. Line 15 below is where the code starts. In this Gist, there are extra lines of code below line 15 that don't appear in the notebook. Copy the code from lines 16 and 17 and paste them in the notebook. Make sure the notebook matches lines 14-17 here.
##########
#extract PISA results for 2009 - 2015
pisa_2015 = filter_dict_by_year(pisa_data, 2015)
pisa_2012 = filter_dict_by_year(pisa_data, 2012)
pisa_2009 = filter_dict_by_year(pisa_data, 2009)
#
#
#
#
#
#
#
### Find the comment on line 30 (here) and match it to the same comment in the notebook. Then, add lines 32 and 33 to the notebook. Make sure it looks exactly like this. Don't worry if the line numbers are different. They will change as you add new lines to the code. ###
#join all tests' results from 2009, 2012, 2015
all_pisa_2015 = merge_dict_by_year(pisa_2015)
all_pisa_2012 = merge_dict_by_year(pisa_2012)
all_pisa_2009 = merge_dict_by_year(pisa_2009)
#
#
### One more time. Find the comment on line 40 (here) and match it to the same comment in the notebook. Add lines 42 and 43 to the notebook. ###
#rename column labels
rename_columns(all_pisa_2015, {'test_score_x': 'math', 'test_score_y': 'read', 'test_score': 'science'})
rename_columns(all_pisa_2012, {'test_score_x': 'math', 'test_score_y': 'read', 'test_score': 'science'})
rename_columns(all_pisa_2009, {'test_score_x': 'math', 'test_score_y': 'read', 'test_score': 'science'})
#
#
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment