Notebooks are interactive documents that let you combine code with other visual elements such as text, charts, and images.
As long as you have a link to a notebook you can share it with your team or modify it from any computer.
You and anyone you've shared your notebook with can collaborate on the notebook by writing parts of it or leave discussion comments.
Notebooks let you mix code, text and images in any order you like, and each piece can be tested independently.
❗ Running code out-of-order may have unintended effects as notebooks run as whole, top to bottom.
We'll show you how to create a notebook on Jupyter Lab in the next post.
[1: Notebook example]
Here's a notebook containing a line of code, some Markdown text, and an image.
And here's how the notebook looks when we run it:
Imagine you have this code:
If you run the lines in order up to line 57, everything will work as intended. However, if after line 57 you run line 2 without running line 1 first, you will get an error.
This is because now x = "something else" and the line 2 code would be:
Which will create an error:
TypeError: can only concatenate str (not "int") to str
So be careful when re-running pieces of code.