No history yet

Installation and Setup

Your Digital Lab Notebook

A Jupyter Notebook is an interactive environment where you can write and run code, add explanatory text, and display visualisations all in one place. Think of it like a scientist's lab notebook, but for working with code. Instead of just writing a program and running it, you can break your work into smaller, manageable chunks called cells. This makes it perfect for exploring data, trying out new ideas, and sharing your work with others.

We can use an analogy to understand how it works. Imagine a chef's kitchen. The user interface, which is the web page you see and type in, is your countertop. It’s where you arrange your ingredients and write your recipe. The kernel is the stove—the engine in the background that does the actual cooking, or in this case, runs your code.

Getting It Installed

There are two main ways to install Jupyter Notebook. For beginners, the easiest path by far is using the Anaconda distribution.

Option 1: Anaconda (Recommended for Beginners)

[{}] is a free, all-in-one toolkit for data science. It bundles Python, Jupyter Notebook, and hundreds of the most popular data science libraries into a single, simple installation. This saves you the hassle of installing and managing each component separately.

  1. Download: Go to the official Anaconda website and download the installer for your operating system (Windows, macOS, or Linux).
  2. Install: Run the installer you downloaded. The setup is straightforward—you can accept the default settings for almost everything.
  3. Done: That's it. Once the installation is complete, Jupyter Notebook is ready to go.

Option 2: Pip (For Existing Python Users)

If you already have Python installed on your computer and are comfortable using the command line, you can use Pip, Python's package manager, to install Jupyter directly.

# Open your terminal or command prompt and run:
pip install notebook

This command tells Pip to fetch and install the Jupyter Notebook package and its dependencies.

Launching and Creating

Once installed, launching Jupyter is simple. If you used Anaconda, open the Anaconda Navigator application and click the "Launch" button for Jupyter Notebook. If you used Pip, just open your terminal or command prompt and type jupyter notebook.

Either way, this will open a new tab in your web browser showing the Jupyter Dashboard. This dashboard is a file browser for your computer.

To create your first notebook, navigate to the folder where you want to save your work. Then, click the "New" button on the top right and select "Python 3" (or whatever kernel is available).

A new tab will open with a blank notebook. This is your workspace! The file will be automatically named "Untitled.ipynb". You can click on the title to rename it. The .ipynb extension stands for "IPython Notebook," a nod to Jupyter's origins.

The Interface and the Kernel

Let's revisit our kitchen analogy. The web page you're looking at is the interface (your countertop). It's where you type your code and text into cells. It's what you see and interact with.

Behind the scenes, a is running. This is the computational engine (your stove). When you run a cell in your notebook, the interface sends the code to the kernel. The kernel executes the code and sends the result back to the interface to be displayed. This separation is powerful because the interface and kernel don't have to be on the same machine.

This client-server structure is what makes Jupyter so flexible. You can run notebooks on a powerful remote server and interact with them from your local web browser, just as easily as you can run everything on your own laptop.

Now that you have Jupyter installed and understand the basics, you're ready to start writing some code. Let's test your understanding of these initial concepts.

Quiz Questions 1/5

What is the primary purpose of a Jupyter Notebook?

Quiz Questions 2/5

For a complete beginner who does not yet have Python installed, what is the recommended method for installing Jupyter Notebook?