Jupyter

Jupyter Logo


Jupyter is an open-source project with the goal of developing comprehensive browser-based software for interactive computing. It has allowed scientists all over the world to collaborate by being able to view and build upon other people’s work.

Jupyter as a project supports three core programming languages which are Python, Julia and R.

Jupyter has products that support data science and scientific computing including Jupyter Notebook, JupyterHub, and JupyterLab.

Jupyter is built from three parts:

  • The notebook front end - The front end allows you to edit and run notebooks. The front end is responsible for storing your notebook, managing your notebooks in your local filesystem, and sending them to the Jupyter server.

  • The Jupyter server - It is a relatively simple application that runs on your laptop or a multi-user server. The Jupyter project’s JupyterHub is the most widely used multi-user server for Jupyter.

  • The kernel protocol - This allows the server to offload the task of running code to a language-specific kernel. Jupyter ships with kernels for Python 2 and Python 3, but kernels for many other languages are available.

Why use Jupyter Notebooks?

Some benefits of using Jupyter Notebook include:

  • Interactive computing: Jupyter Notebook allows users to execute code in interactive cells, making it easy to experiment, debug, and iterate on code.
  • Rich output: Jupyter Notebook supports various output formats, including text, images, videos, and interactive visualizations, providing a rich and engaging way to present data and results.
  • Narrative text: Jupyter Notebook allows users to combine code with narrative text, making it easy to create reproducible research documents, tutorials, and reports.
  • Collaboration and sharing: Jupyter Notebook can be easily shared with others, enabling collaboration on projects and facilitating the dissemination of knowledge and results.

Getting started with Jupyter Notebook:

To get started with Jupyter Notebook, you can install the Jupyter package using pip:

$ pip install jupyter

After installing Jupyter, you can launch the Jupyter Notebook server by running the following command in your terminal:

$ jupyter notebook

This will open the Jupyter Notebook interface in your web browser, allowing you to create, edit, and run notebooks.

Jupyter Notebook example: Here’s an example of a simple Jupyter Notebook cell that contains Python code:

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0, 10, 100)
y = np.sin(x)

plt.plot(x, y)
plt.xlabel("x")
plt.ylabel("sin(x)")
plt.title("Sine Wave")
plt.show()

In this example, we import the NumPy and Matplotlib libraries, generate a sine wave, and plot the results using Matplotlib. By executing the cell, the plot will be displayed directly in the Jupyter Notebook.

Resources:

  • Setup Jupyter notebook on AWS Ec2
  • Comprehensive guide to Jupyter Notebook
  • Project Jupyter