Jupyter Notebook and Markdown

Let’s Do Digital Team

Jupyter Notebook

What is Jupyter Notebook?

  • Jupyter Notebook is an interactive tool for writing and running code.
  • Used mostly for Python but supports other languages.
  • Combines code, text, and visualizations in one place.

Why Use Jupyter Notebook?

  • Great for learning, experimenting, and prototyping.
  • Interactive: Run code and see results step by step.
  • Easy to combine code with explanations and visuals.
  • Ideal for data analysis, machine learning, and teaching.

What does Jupiter Notebook look like?

Jupyter Notebook Interface

However…

  • We are going to use Codespace with the Jupyter extension.

Codespace and Jupyter

Key Features of Jupyter Notebook

Write and execute code in cells

Mix code, explanations, images, and graphs

Visualise data

Share work with others

  • Share via GitHub.
  • Share via Google Colab.
  • PDF, HTML, or slides.

How to run code?

  • Run a cell: Press the Play button.
or

Common Jupyter Notebook Tasks

  • Add text to explain code.
  • Run your code.
  • View results instantly: Print or plot results directly in the notebook.
  • Save your work: Notebooks are saved as .ipynb files.

Markdown

What is Markdown?

  • Markdown is a simple way to format text.
  • You can use it to write headings, lists, and more.
  • Useful for adding explanations and notes in Jupyter Notebooks.
  • Supports basic formatting without complex code.
  • It is often used to create web content as a much similar alternative to HTML.

Why Use Markdown in Jupyter?

  • Makes your notebook readable with clear explanations.
  • Organise your notebook with sections, lists, and links.
  • Perfect for combining code, results, and explanations in one place.
  • No need for external software to write documentation.

Make a cell ready for Markdown

  • Change a cell to ‘Markdown’ mode.
  • Add your markdown text to the cell.

Headings in markdown

  • Use # to create headings.
# Heading 1
## Heading 2
### Heading 3


Renders to:

Heading 1

Heading 2

Heading 3

Comments in markdown

  • Use <!-- --> to create comments.
  • Same as comments in html.
<!-- This is a comment -->
This is not a comment


Renders to:

This is not a comment

Bold

  • Use **your text** to make text bold.
**This is bold text**


Renders to:

This is bold text

Italic

  • Use *your text* to make text italic.
*This is italic text*


Renders to:

This is italic text

Lists

  • Use * or - to create bullet points.
* Heart
* Lungs


Renders to:
  • Heart
  • Lungs

Numbered lists

  • Use 1. to create numbered lists.
1. Lymphatics
2. Red blood cells


Renders to:
  1. Lymphatics
  2. Red blood cells

Markdown to normal text

  • Click the tick when you are ready to render markdown to normal text.

Open a file in Jupyter

open_a_file.py
with open('your_patient_data.txt', 'r') as file:
    content = file.read()

Start up a Codespace session

First

  • Make sure you have a GitHub account.
  • Join your tutor group in the named Zoom break out rooms.
  • Go to the page at https://github.com/letsdodigital/coding-hands-on
  • Click on the <> Code button and then the Codespaces tab.
  • Click on Create codespace on main

Break out room button

Screen shot of the breakout room button in Zoom

Codespace load

Screen shot of Github website with arrows showing how to start up Codespace

Codespace light theme

Codespace light theme screen shot

Codespace dark theme

Codespace dark theme screen shot

Codespace layout

Codespace layout

Codespace what / where?

Codespace layout with areas highlighted

We need some extensions

  • AKA Plugins.
  • Add functionality and features, much like your favourite app store.

We need some extensions

  • Python
  • Jupyter

Python extension

screen shot of the VS Code Python extension

Jupyter Notebook extension

Screen shot of the VS Code Jupyter Extension

Ignore this

  • Ignore the pop out about extensions you may get in the bottom right of Codespace
Screenshot of python extensions pop out

Get to your first lesson

  • Open the lesson_1.ipynb file (not the answers file!).

  • Run through the exercises within the notebook.

  • Any problems, just ask your tutor for help.

  • There is no such thing as a stupid question, only the question left unanswered.

  • We will give you 20 minutes for lesson 1.