1. Preparatory Work#

This section is intended for use in the introductory sessions held in 1st week for PPL and Human Science students. BMS students will have a separate introductory session.

1.1. Tasks for this week#

The objectives for the introductory session are as follows:

Familiarise yourself with Jupyter#

Throughout this course we will work with Python exercises and worked examples gathered in this book.

These exercises and examples are written as Jupyter notebooks - a type of file in which blocks of text and code can be included

When you view the book online you see the code already ‘executed’ - each code block has been run and its output is displayed below the block

However, you will want to interact with the code not just look at it!

You have two options here:

Google colab#

You can open each workbook in an executalbe and editable format on the web, without downloading anything

To do this you click on the little rocket icon in the top right (only on pages with actual code in - look on one of the “rolling a virtual dice” pages - and select “open in Colab”

Warning

Note that although you can run and editthe workbook on the web with Colab, you would need to save your work if you want it to last after you close the session (sessions will also timeout if left for a few minutes). You can save your edited notebook to your Google Drive if you have a Google account by clicking File > Save a copy in drive

It will appear as a .ipynb file and can be reopened and further edited (or emailed to your tutor for hand-in exercises)

This is the minimum-setup option but can be clunky. I’d recommmend if possible working on your local computer with Spyder.

Download and work locally (preferred)#

Your other option is to download the notebook to your computer (or the lab PC if your tutorial session is in the computing lab).

You can then open the notebook locally using either Jupyterlab, or Spyder

Tip

I recommend working with Spyder if possible as you will also have the command line available to quickly check bits of code (this jargon will make sense soon even if it sounds obscure right now!)

Know thy computer#

If you are using the teaching lab computers to run notebooks with Spyder (Psychology/PPL students only), watch out - files saved on the computers will not be saved after you log out

Warning

Psychology students working on the computing lab computers - you need to save your work to One Drive. Anything you save on the computer will be wiped when you log off.

Sort IT issues#

You may wish to set up Spyder to work on the Jupyter notebooks (and with Python more generally) on your own laptop.

This should be possible for most laptops and we have “cheat-sheets” to get you started.

We can’t promise to make everyone’s software work on their own computer but we will have a go and today is a good time to try as someone will be around to help.

Get up to date with datacamp#

You should have had a letter from me over the summer advising you to complete some online modules on datacamp, covering Python basics

If you didn’t do this or didn’t/couldn’t finish it, you should come back to it today - tutors are here to help you if you get stuck

Do the further exercises in this book#

The section “preparatory work” is intended to be completed in the preparatory session (although I realise not everyone will manage this - that is OK, all topics will be revisited in the course)

More practice#

I can’t believe anyone will get this far, but if you do, you can find more coding practice exercises here