Reproducible Research

Activity 4 | Experimenting with the Code

Use the following code snippets to alter the PISA notebook.

Click on the launch binder button in the PISA repository:

  • If you make a mistake and break the code beyond repair, you can check the source file to copy and paste the original code. You can also try pressing File > Revert to Checkpoint in the Jupyter notebook top menu.

1. Turn on line numbers.

toggle line numbers

2. Run all of the cells.

run all of the cells

3. Got to cell 6. Follow the instructions on lines 14, 37, and 51 below.

4. Re-run cell 6 by clicking in the cell and pressing shift + return. If there are any errors, check your code for typos and try again.

From here on, the cell numbers in the Jupyter notebook will change depending on how many times you run the code within that cell.

5. Insert a new cell for each of the additional years you’ve added.

add new cells

6. Type the additional variable names into the new cells and press shift + return to run each one.

For example:

If there are errors, check for typos and try again.

7. See how many other cells you can get to work! Both with the existing variables, and the new variables you’ve created.