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:
usage
contains 411 unique water district IDs. We are expectingusage_totals
to have 411 rows, corresponding to the 411 water districts.We are expecting
wd_income
to 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.join
should correctly result in awd_income
having 409 rows. If your code produced awd_income
with 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_50
assigns 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
income
labels - Correct
income
labels - Correct
income
labels - Correct
income
labels - Correct
income
labels - Correct EITC calculation
- Number of
income
rows - Number of
usage_totals
rows - Correct
population
forusage_totals
- Correct
total_water
forusage_totals
- Number of
wd_income
rows - Correct
income_prop
forwd_income
- Correct number of nonzeros in
income_50
forwd_income
- Correct
income_50
forwd_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
-----