Jupyter Notebook Tutorial
Jupyter Notebook Tutorial
Jupyter Console
Jupyter Notebook
https://www.javatpoint.com/jupyter-notebook
What’s the difference between JupyterLab and Jupyter
Notebook?
While both Jupyter lab and Notebook support programming languages such as Python,
Julia, Scala, and R, support for all these languages come preinstalled with Jupyter lab.
Jupyter notebook only offers a very simple interface using which users can open
notebooks, terminals, and text files.
Jupyter lab offers a very interactive interface that includes notebooks, consoles,
terminals, CSV editors, markdown editors, interactive maps, and more. In the Jupyter
lab, notebooks also have a few improvements like the drag and drop cells feature which
is not available in the Jupyter notebook. Overall, JupyterLab can be considered as an
extension to Jupyter notebook to increase its scope.
Ipython
https://www.tutorialspoint.com/jupyter/ipython_introduction.htm
https://ipython.readthedocs.io/en/stable/interactive/magics.html
https://www.tutorialspoint.com/jupyter/ipython_magic_commands.htm
https://problemsolvingwithpython.com/02-Jupyter-Notebooks/02.06-Magic-
Commands/
Note: Jupyter Notebook mainly used for Python because Python is used with Artificial
Intelligence (AI), Machine learning, as well as Deep learning.
Step4: Once the installation is completed, the following window is open, you simply click on
the close.
Once the Python installation is completed, follow the below steps to install the Jupyter
Notebook with pip package.
Step2: Copy/ set the path, where the Python script is presented.
For Example:
1. Path= C:\Users\Manya\AppData\Local\Programs\Python\Python37\Scripts
Note: If AppData is not visible, then go to View -> Options, select change folder, and search
options. After clicking on the select change folder, click on the view, and select show hidden
files, folders, and drives then click on the Apply -> OK.
Step3: To upgrade the older version of pip, give the following command after the specified
path:
Step5: Once the installation process is completed, you can run your notebook on the server
using the following command in command prompt.
1. jupyter notebook
After a few seconds, Jupyter notebook starts with the default web browser which shows the
list of all python files.
The Files tab is used to display files and folders in the current directory. It also uses
an Upload button through which a file can be uploaded to a notebook server.
Running Tab
Cluster Tab
IPython provides the Cluster Tab. IPython is a parallel computing framework, which is an
extended version of the IPython kernel.
User interface of Jupyter Notebook
When you create a new notebook, the notebook will be presented with the notebook name,
menu bar, toolbar, and an empty code cell.
Notebook name: Notebook name is displayed at the top of the page, next to the Jupyter
logo.
Menu bar: The menu bar presents different options that are used to manipulate the
notebook functions.
Toolbar: The toolbar provides a quick way for performing the most-used operations within
the notebook.
Code cell: A code cell allows you to edit and write a new code.
1. The notebook web application: It is an interactive web application for writing and
running the code.
o Edit code in the browser with automatic syntax highlighting and indentation.
o Run code on the browser.
o See results of computations with media representations, such as HTML, LaTex, png, pdf, etc.
o Create and use JavaScript widgets.
o Includes mathematical equations using Markdown cells.
2. Kernels: Kernels are the separate processes started by the notebook web application
that is used to run a user's code in the given language and return output to the notebook
web application.
o Python
o Julia
o Ruby
o R
o Scala
o node.js
o Go
Creating a Notebook
To create a Notebook in Jupyter, go to New and select Python3.
Now, you can see that a new notebook opens in a new tab.
2. Markdown Cell
Markdown cell provides documentation to the notebook and makes the notebook more
attractive. This cell contains all types of formatting features such as making text bold and
italic, headers, displaying ordered or unordered list, Bullet lists, Hyperlinks, tabular contents,
images, etc.
To perform the following formatting features, first select Markdown cell from the drop-down
menu.
Bold and Italics
o To make text bold, write text between the double underscores or double asterisks.
o To make text italics, write text between single underscore or single asterisk.
Headers
Creating headers in Markdown is quite similar to the creating headers in HTML. It displays
text in 6 sizes. To make the text as a header, start the text using # symbol. The number of #
symbols depends upon the size of the header.
For example -
Header 1 use one # symbol, header 2 use two # symbol, and so on.
The following screenshot shows the output of the above Header cells.
Ordered Lists
The ordered list starts with 1. Use tab to make the suborder followed by the order.
The following screenshot shows the output of the above Markdown data.
Bullet lists
In Jupyter notebook, if text starts with the dash (-) symbol, markdown cell coverts dash into
a solid circle and asterisk (*) to a solid square.
The following screenshot shows the output of the above Markdown data.
Hyperlinks
Markdown cell allows you to attach the Hyperlink. To attach the hyperlink place the name of
the link in square brackets [] and write link inside the parentheses ().
Table Content
Markdown cell allows you to create a table using pipe symbol (|) and dash symbol (-). Pipe
symbol (|) is used for making columns, and dash symbol (-) is used for making the rows.
Images
To insert the image in a markdown cell, you first need to insert the image in the same
directory. For this, go to Jupyter dashboard -> select Upload, specify the path of an image
then click on Open.
Once the image is seen in the dashboard click on the Upload, you can see that image is
uploaded in the dashboard.
Now, go to your current Notebook, and type the following code to insert the image.
The following screenshot shows that the image is inserted on the Notebook.
4. Heading Cell
The Jupyter Notebook does not support the heading cell. When you select the Heading from
the drop-down menu, a pop will open on the screen which is shown in the below screenshot.
By default, ipywidgets are installed in Anaconda or you can also install it manually
with conda.
1. Text widget
Output:
2. Button widget
The button widget is similar to the HTML button. To create button, type the following
code.
Output:
3. color picker
The Color picker allows you to select a color as per to your requirement.
Output:
When you click on the square box, the following pop up will open.
4. Slider
Sider is used to find the range and interval between two entities.
Output:
Output: