A repository for notebook copies of the lessons in SWD1a, that can be launched in Colab.
To update a file/create the notebook:
- Copy the
.mdfile for the lesson, and strip out links, images, andRmdcode fencing (marked by:::, for callout blocks etc.) - In a Python env with Jupytext, run
jupytext --to ipynb 01-intro.mdto create01-intro.ipynb. - Check that Jupyter notebook looks correct and is functional; ensure that you clear all output before saving.
- Remove large "solution" blocks to the challenges where appropriate.
- Generate link for Colab: after pushing to the repository, replace the
github.comin the url to the notebook withhttps://colab.research.google.com/github - Remember to add cells for downloading and unzipping the data when necessary.
(These are given in the order we deliver our materials in)
Provide learners with the snippet below (this is added to the beginning of the first notebook).
Note that links in these notes may be broken, please see the course notes here for correct links etc.
When you read a challenge asking you to do something, don't read beyond the next header that reads "Solution". Insert a new code cell below the question and attempt to solve it yourself before reading on.
When you see a piece of code, remember:
- Before you do anything else, predict what the output is going to be.
- Then run it, and compare the output to your prediction.
- You can begin to investigate, especially if your guess is way off - what information can you find in the notes, or online?
- Once you've tried to understand how the code works, try to modify it and make some changes.
- Then, you're ready to start making your own code!
We will mainly be cycling through stages 1 and 2, with some of the later stages coming in as you build more knowledge.