Getting Started with Jupyter Notebook

Jupyter Notebook is an open-source web application that lets you create and share documents containing live code, equations, visualizations, and narrative text. It's a powerful tool for data science, machine learning, and academic research — enabling an interactive and readable way to write and present Python code.

Here’s what makes Jupyter Notebooks so useful:

  • Live code execution: Run Python code directly in the notebook and see results immediately.
  • Rich text support: Combine code with explanations using Markdown for clear documentation.
  • Visualizations: Display charts, plots, and images directly within cells.
  • Step-by-step development: Write and test your code incrementally.
  • Reproducibility: Share your notebooks and rerun them to reproduce results easily.

⚙️ Installing Jupyter Notebook

You can install Jupyter Notebook in two main ways: using pip (Python’s package manager) or via the Anaconda distribution, which includes Jupyter and many other tools for data science.

Option 1: Install with Anaconda

Anaconda is a free and popular distribution for Python and R that comes with Jupyter Notebook pre-installed. This is the recommended method for beginners.

👉 Download Anaconda from the official site:https://www.anaconda.com/products/distribution

After installation, open the Anaconda Navigator and launch Jupyter Notebook from there.

anaconda navigator interface

Tip: Anaconda also installs many useful packages like NumPy, Pandas, and Matplotlib — great for data science!

Option 2: Install with pip

If you already have Python installed, you can install Jupyter Notebook using pip.

pip install notebook

💡 Note: On macOS or Linux, you may need to use pip3 instead of pip, depending on your Python setup.

Once installed, you can launch it using:

jupyter notebook

This will open a new tab in your browser where you can start creating and running notebooks.

Option 3: Use Google Colab (No Installation Needed)

Google Colab is a free, cloud-based Jupyter Notebook environment provided by Google. You can run Python code directly in your browser without installing anything on your computer.

Just go to: https://colab.research.google.com

You’ll need to sign in with a Google account. Once logged in, you can:

  • ➕ Create a new notebook
  • 📂 Upload an existing notebook file (.ipynb)
  • 🔗 Open notebooks from Google Drive or GitHub

Bonus: Colab includes many popular Python libraries like NumPy, Pandas, and Matplotlib pre-installed.


🚀 Exploring Jupyter Notebook

Creating a New Notebook

In the Jupyter interface, click NewNotebook to create a new notebook.

Notebook Interface Overview

  • Cells: Areas where you write and run code or Markdown.
  • notebook-cell
  • Toolbar: Buttons to save, run cells, restart kernel, etc.
  • notebook-toolbar
  • Kernel: The engine that runs your code; shows whether it’s idle, busy, or restarting.

Running Code

Write Python code in a cell and press Shift + Enter or click the ▶︎ Run (play) button in the toolbar to run it. You’ll see the output directly below the cell.

notebook-cell

📝 Understanding Cells (Code vs Markdown)

Jupyter Notebooks are made up of cells, which are individual blocks that can contain either code or text.

Code cells are where you write and run your Python code. When you execute a code cell, the output (like results or errors) appears right below it.

Markdown cells allow you to write formatted text using Markdown syntax. This is great for adding explanations, titles, lists, links, and more to your notebook, making it easier to read and understand.

You can switch a cell’s type between Code and Markdown using the dropdown menu in the toolbar or by pressing keyboard shortcuts (Y for code, M for markdown).

notebook-cell

🚀 What's Next?

Next, we’ll show you how to install NumPy, one of the most essential libraries for numerical and scientific computing in Python.