Project 1
Part 1 Instructions
To run the tests, temporarily turn on "Edit Mode" and change the final cell
of project1_part1_v2.ipynb (make sure you are using version 2, it is the one
we will pull your code from) to read
# ok
!ok --local --config 01.ok -v 2>/dev/null
Then, turning off edit mode and clicking "Run ok tests" will then correctly run the tests.
A Note On Water Districts (must read!)
You may have noticed that some of the tables involved in part 1 have different numbers of water districts. Here is what we are expecting for the tests:
usagecontains 411 unique water district IDs. We are expectingusage_totalsto have 411 rows, corresponding to the 411 water districts.We are expecting
wd_incometo only have 409 rows. The reason for this is that there is one water district that does not appear inwd_vs_zip(1910092) and there is a water district (3110001) that does not contain parts of any zip codes contained inincome_raw. Completion of Part 1 naively using.joinshould correctly result in awd_incomehaving 409 rows. If your code produced awd_incomewith 411 rows (which is perfectly fine — those districts should probably have zero income in your table), you can remove them withwd_income = wd_income.where((wd_income['pwsid']!= '1910092') & \ (wd_income['pwsid']!= '3110001'))- You may have noticed that the calculation for
income_50assigns zero income to some water districts (around 200). Make sure that these water districts still appear inwd_income, since they will have a nonzero value forincome_prop.
Test Descriptions
Not all tests are worth equal points; harder ones are worth more.
- Number of
incomelabels - Correct
incomelabels - Correct
incomelabels - Correct
incomelabels - Correct
incomelabels - Correct EITC calculation
- Number of
incomerows - Number of
usage_totalsrows - Correct
populationforusage_totals - Correct
total_waterforusage_totals - Number of
wd_incomerows - Correct
income_propforwd_income - Correct number of nonzeros in
income_50forwd_income - Correct
income_50forwd_income
Part 2 Instructions
As in part 1, make your changes in project1_part2_v2.ipynb. To run the ok
tests properly, your last cell must contain:
# ok
!ok --local --timeout 20 --config 02.ok -v 2>/dev/null
-----