What are Notebooks?

This is part of the “Intro to Data Analysis with Python” series of posts, with content from the Enki app. If you stumbled upon this, you could start from the beginning.

Notebooks are interactive documents[1] 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[2] as notebooks run as whole, top to bottom.

We'll show you how to create a notebook on Jupyter Lab in the next post.

Footnotes

[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:

[2:Unintended Consequences]

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.

Chat with us to learn more

Continue reading

Our newsletter

Get the best curated articles

No spam!