0% found this document useful (0 votes)
141 views

Jupyter

Jupyter provides web-based notebooks and environments for interactive computing. It includes Jupyter Notebook for creating and sharing documents with code, equations, visualizations and narrative text. JupyterLab is a next-generation web-based interactive development environment, and JupyterHub allows for multi-user notebook servers. Jupyter can be installed with pip and supports various programming languages.

Uploaded by

Ankith naidu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
141 views

Jupyter

Jupyter provides web-based notebooks and environments for interactive computing. It includes Jupyter Notebook for creating and sharing documents with code, equations, visualizations and narrative text. JupyterLab is a next-generation web-based interactive development environment, and JupyterHub allows for multi-user notebook servers. Jupyter can be installed with pip and supports various programming languages.

Uploaded by

Ankith naidu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Jupyter

with Python
What is Jupyter?

Free software, open standards, and web services for in-


teractive computing across all programming languages
~ https://jupyter.org/

Classic New

Jupyter Notebook JupyterLab


Original web application Web-based interactive
for creating and sharing development environment (IDE)
computational documents. for notebooks, code, and data.

JupyterHub
A multi-user version of the notebook designed
for companies, classrooms, and research labs.

The Littlest JupyterHub


For smaller deployments
(0-100 users on a single server)

We are talking about


Jupyter and not Jupiter. Uranus
Neptune

Mars
Jupiter

Earth
Saturn

Mercury
Venus

Sun @atoti
Installation

Jupyter
Jupyter metapackage. Install all the Jupyter components in one go
(including the notebook, qtconsole, and the IPython kernel).

pip install jupyter

Jupyter Notebook
A web-based notebook environment for interactive computing.

pip install notebook

JupyterLab
JupyterLab will eventually
A browser-based IDE. Comes with Jupyter Notebook as well! replace the classic Jupyter
Notebook

pip install jupyterlab

* Refer to Jupyter’s documentation for installation via other tools such as conda and mamba.

You can also install Jupyter when you install


atoti along with its JupyterLab plugin:

pip install atoti[jupyterlab]

More on later.

Reference:

● https://pypi.org/project/jupyter/
● https://pypi.org/project/notebook/
● https://pypi.org/project/jupyterlab/
● https://docs.atoti.io/latest/getting_started/installation.html

@atoti
Running the servers
Run the respective commands in a Terminal on Mac/Linux, or Command
prompt on Windows to launch either the Jupyter Notebook or JupyterLab.

Jupyter Notebook

jupyter notebook

Access instance via the URL printed in terminal (including token string unless security disabled):

[I 10:10:13.334 NotebookApp] Serving notebooks from local directory: C:\atoti


[I 10:10:13.334 NotebookApp] Jupyter Notebook 6.4.10 is running at:
[I 10:10:13.334 NotebookApp] http://localhost:8888/?token=c075a91d119a4d7192bf6e36b60ea3aca9960cfea1772461
[I 10:10:13.334 NotebookApp] or http://127.0.0.1:8888/?token=c075a91d119a4d7192bf6e36b60ea3aca9960cfea1772461
[I 10:10:13.334 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 10:10:13.714 NotebookApp]

To access the notebook, open this file in a browser:


file:///C:/atoti/AppData/Roaming/jupyter/runtime/nbserver-960-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=c075a91d119a4d7192bf6e36b60ea3aca9960cfea1772461
or http://127.0.0.1:8888/?token=c075a91d119a4d7192bf6e36b60ea3aca9960cfea1772461 notebook

JupyterLab

jupyter lab

Access instance via the URL printed in terminal (including token string unless security disabled):

[I 2022-06-06 10:23:31.621 ServerApp] Serving notebooks from local directory: C:\atoti


[I 2022-06-06 10:23:31.621 ServerApp] Jupyter Server 1.16.0 is running at:
[I 2022-06-06 10:23:31.621 ServerApp] http://localhost:8888/lab?token=fe443f01f64c52e20a87cc22851d2936e2eb8046565f9e6e
[I 2022-06-06 10:23:31.621 ServerApp] or http://127.0.0.1:8888/lab?token=fe443f01f64c52e20a87cc22851d2936e2e-
b8046565f9e6e
[I 2022-06-06 10:23:31.622 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2022-06-06 10:23:32.062 ServerApp]

To access the server, open this file in a browser:


file:///C:/atoti/AppData/Roaming/jupyter/runtime/jpserver-9208-open.html
Or copy and paste one of these URLs:
http://localhost:8888/lab?token=fe443f01f64c52e20a87cc22851d2936e2eb8046565f9e6e
or http://127.0.0.1:8888/lab?token=fe443f01f64c52e20a87cc22851d2936e2eb8046565f9e6e
[I 2022-06-06 10:23:36.744 LabApp] Build is up to date

The URL will be automatically


opened in the default web
browser, displaying the Note-
book dashboard / JupyterLab
interface.

@atoti
Jupyter Notebook or JupyterLab?

Classic Jupyter

Fixed cell order

Exploratory computing
Single-paged viewer

Data visualization

One of JupyterLab’s many applications


New JupyterLab

Multiple tabs within


a browser tab Visual debugger
Has a thriving
community
of third-party Ability to open
extensions notebooks,
Python files,
terminals, and
text files etc
within the in-
terface.
File browser within
same browser tab
Ability to select & re-arrange cell order

@atoti
Create step-by-step
tutorial with a Notebook

Auto-generated table of
contents with clickable
entries (JupyterLab only)

Cells support Markdown


and LaTeX for writing
structured instruction
and guides

Interlay instruction
with runnable codes
for interactive tutorial

Download atoti tutorial notebook for reference: python -m atoti.copy_tutorial tutorial

Or complement your data analysis with visualizations

Some useful libraries for visualizations:

• Seaborn Good for explaining concepts


• Matplotlib in static presentations
• Plotly
Good for self-exploration
• Bokeh
via the interactive visuals
• atoti

Example from https://github.com/atoti/notebooks/blob/master/notebooks/wine-analytics/main-full.ipynb

@atoti
Storytelling in JupyterLab
Bridge the gap between the technical and business

Showcase technical implementation


along with interpretation of data that
address business concerns
Highlight business
problems with Markdown

Example from https://github.com/atoti/notebooks/blob/master/notebooks/food-processing/main.ipynb

Take note of the non-linear workflow of Jupyter…

Storytelling works best here only


if you run the cells sequentially!
Otherwise, you might end up
with unreproducible results

A notebook (i.e., a file with .ipynb extension) can


run in both Jupyter Notebook and JupyterLab.

BUT…
Some libraries and extensions make
JupyterLab friendlier to use!

@atoti
Some friendly libraries & extensions…

1. JupyterLab Code Formatter


https://ryantam626.github.io/jupyterlab_code_formatter/index.html#quick-start

pip install jupyterlab-code-formatter isort black

Click this icon to format


the cells in the notebook

Mismatching brackets or quotes in codes


will show up when formatting fails…

2. atoti and its JupyterLab extension


https://www.atoti.io/

pip install atoti[jupyterlab]

atoti is a free Python library that allows users to create multidimensional datacubes.
Additionally, users can also build and share dashboards with atoti’s web app!

Change visualization
type from drop-down

Access the
atoti editor

Perform actions such as zoom


in/out, resize, export or drill-
Drag and drop hierarchies through widget interactively
and measures to build
visualizations interactively

When your audience asks a question, use atoti to build


your visualition interactively on the spot.
You’ll look savvier than when you code the visuals
(especially so if you struggle with the syntax).

@atoti
Some friendly libraries & extensions…

3. Jupyterlab-geojson
https://github.com/jupyterlab/jupyter-renderers/tree/master/packages/geojson-extension

pip install jupyterlab-geojson

Plot GeoJSON data in JupyterLab.

4. ipywidgets
https://ipywidgets.readthedocs.io/son-extension

pip install ipywidgets

Build interactive GUIs for notebooks!

Progress bar

Multi-select list

@atoti
Use to bridge the gap
between ML and business KPIs

Learn more
about atoti at:
https://www.atoti.io/

Follow atoti on:

LinkedIn Youtube

https://www.linkedin.com/company/atoti https://www.youtube.com/c/atoti

Twitter Medium

https://twitter.com/atoti_io https://medium.com/atoti

Reach out to atoti on:

GitHub Discussions

https://github.com/atoti/atoti/discussions

@atoti

You might also like