You can think of your notebook as an electronic lab book. Just as when you're doing hands-on experiments in the lab, it's important to keep a record of what you're doing when you're working with code. With notebooks you can keep your notes alongside the code.
Notebooks have different types of cells, the main ones being markdown and code. While you can write comments in your code cells using # at the start of a line, it's not ideal for when you need much more detail than '# set this to 7' (or, as most of my code comment say '# don't know why this isn't working....'). Markdown cells let you include text, images, equations etc so you have a proper record of what your code is doing and why.
To change a cell to a markdown cell, click on the arrow next to 'Code' at the top of the notebook and select 'Markdown'
If you've ever posted on an internet forum, you've probably already used markdown, although you may not have realised it!
You can make headings of different sizes using # at the start of a line. # big (#) ## medium (##) ### small (###)
You can make text italic using one * at each end of the text. Bold uses two **.
Making lists is easy too!
(The list above was numbered 1, 2, 3, 7, 4)
A nice markdown cheatsheet can be found here
If you want to add an image to a cell, the easiest way is to click 'Insert Image' in the 'Edit' menu at the top of the notebook.
You can include equations in markdown cells using LaTeX. LaTeX is a typesetting language that you'll likely come across when you're writing lab reports. Some LaTeX stuff can be (overly)complicated, but for now we just care about the LaTeX math
environment.
If you want to include an equation on a new line (like you would in a lab report), use two \$ signs at the start and end, e.g.:
$$ M = a \log{P} + b $$
will be rendered as:
If you want to include something in the middle of your text just use one \$ sign, e.g. :
The standard deviation, $\sigma$ is the square root of the variance, $\sqrt{\sigma^2}$
will display as:
The standard deviation, $\sigma$ is the square root of the variance, $\sqrt{\sigma^2}$
Here is a nice reference sheet for LaTeX maths symbols and operators.