×

Working with Jupyter notebooks

← MATH4120 Home

The Marimo notebooks you use for lectures and labs are great for exploring — but as that guide explains, they don't save anything. For a lab exercise you want to finish properly, and for every assignment, you'll instead work in a Jupyter notebook: a real .ipynb file that lives on your computer (or a shared drive), that you can close, reopen, edit further, and submit.

The short version

Get Jupyter running (campus PC or your own laptop — see below), download the .ipynb version of the notebook you're working on, open it in Jupyter, do your work, save, and submit that file.

Don't worry if this doesn't click straight away

We'll go through all of this together in the first computer lab, and by the end of that session everyone should have Jupyter up and running. If you're not quite there yet, just raise your hand in the lab, or get in touch afterwards — nobody is expected to have this sorted out alone.

That said, it really is worth getting working as early as possible. Like any new tool it feels fiddly the first time, but it quickly becomes second nature — so the sooner you start, the sooner it stops being something you have to think about, and you can focus on the mathematics.

Getting Jupyter running

You need a working copy of Python plus Jupyter Notebook. The easiest route for almost everyone is Anaconda, a free bundle that installs Python, Jupyter, and all the scientific libraries you'll need (NumPy, SciPy, Matplotlib) in one go.

On a Lancaster campus PC

Campus Windows PCs don't have Anaconda installed by default, but you can get it in a couple of minutes through AppsAnywhere, the university's software-on-demand system:

  1. Log in to the PC with your university account, then open AppsAnywhere from the Start menu.

  2. Search for Anaconda and launch it. AppsAnywhere streams it to the PC — no admin rights needed.

  3. Once Anaconda has started, find Jupyter Notebook in the Anaconda menu that appears and launch it. A browser tab will open showing a file browser — that's Jupyter, running locally on the machine you're sitting at.

On your own laptop

LaptopRoute
WindowsEither install Anaconda directly, or use AppsAnywhere exactly as above — it also works off-campus once you sign in with your university account.
MacDownload and install Anaconda (there's a macOS installer on the same page). Open the Anaconda Navigator app it installs, and launch Jupyter Notebook from there.
LinuxInstall Anaconda from the same page, or if you're already comfortable with a terminal: pip install notebook, then run jupyter notebook.

Only need this once

Anaconda is a one-time install. After that, starting Jupyter for any future session is just: open Anaconda Navigator (or AppsAnywhere on a campus PC) and launch Jupyter Notebook again.

Downloading and saving a notebook

Each chapter on the home page has a purple Jupyter button (downloading a .ipynb file) next to its lecture and lab notebooks. To work on one:

  1. Download the .ipynb file to your computer (or a folder on a shared/university drive if you're on a lab PC and want to keep working on it elsewhere).

  2. In Jupyter's file browser tab, navigate to where you saved it and click to open it.

  3. Do your work. Jupyter runs each code cell locally on your machine, so nothing disappears when you close the tab.

  4. Save regularly with Ctrl+S (Cmd+S on a Mac) — this writes your changes back into that same .ipynb file on disk.

Sliders won't move — that's expected

Each downloaded notebook opens with any sliders frozen at whatever value they had in the lecture, since plain Jupyter has no marimo runtime to drive them. The first cell links back to the live, drag-the-sliders version on the course site if you want that instead. Everything else — the code, the plots, the maths — works exactly as normal.

Markdown basics

Jupyter notebooks mix code cells with Markdown cells — plain-text cells that render as formatted text, for writing explanations alongside your code. You'll use these to answer written questions in assignments. The syntax is deliberately minimal:

You typeYou get
# HeadingA big heading (use ##, ### for smaller ones)
**bold**bold
*italic*italic
- itemA bullet list
[text](url)A link
$x^2 + y^2 = r^2$Inline maths: x² + y² = r²
$$\int_0^1 x\,dx$$A centred display equation

To turn a cell into Markdown in Jupyter, select it and press Esc then M, then Shift+Enter to render it.

Submitting an assignment

Assignments are submitted as the .ipynb file itself, not a PDF or screenshot, so your code can actually be run and checked. Exact submission details (where on Moodle, how to name the file, individual or group) will be given with each assignment — this page just gets you to the point of having Jupyter open and a notebook you can save.

Tools used here

← Back: working with Marimo · Home →