Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All).
Make sure you fill in any place that says
YOUR CODE HERE or "YOUR ANSWER HERE", as well as your name and collaborators below:
NAME = "" COLLABORATORS = ""
import os import os.path import pandas as pd datadir = "publicdata"
path = os.path.join(datadir, "topnames.csv") topnames0 = pd.read_csv(path) topnames = topnames0.set_index(['year', 'sex']) names0 = topnames0.head(10) names = topnames.head(10)
path = os.path.join(datadir, "indicators.csv") indicators0 = pd.read_csv(path) indicators = indicators0.set_index(['code', 'year']) rowinclude = lambda code, year: code in ['CAN', 'IND', 'USA'] and year >= 2013 z = zip(indicators0['code'], indicators0['year']) bools = [rowinclude(code, year) for code, year in z] ind0 = indicators0[bools]
ind0 = ind0.reset_index(drop=True) ind = ind0.set_index(['code', 'year'])