Introduction to Jupyter Notebook — Python Numerical Methods
Introduction to Jupyter Notebook — Python Numerical Methods
This notebook contains an excerpt from the Python Programming and Numerical Methods - A Guide Contents
for Engineers and Scientists, the content is also available at Berkeley Python Numerical Methods. Start Jupyter notebook
Within the notebook
The copyright of the book belongs to Elsevier. We also have this interactive book online for a better
Shut down the Jupyter notebook
learning experience. The code is released under the MIT license. If you find this content useful, please
Close a notebook
consider supporting the work on Elsevier or Amazon!
< 1.3 Managing Packages | Contents | 1.5 Logical Expressions and Operators >
The Jupyter Notebook is an open-source web application that allows you to create and share
documents that contain live code, equations, visualizations and narrative text. Uses include: data
cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine
learning, and much more.
Jupyter notebook is running using your browser, it could run locally on your machine as a local server or remotely
on a server. The reason it is called notebook is because it can contain live code, rich text elements such as
equations, links, images, tables, and so on. Therefore, you could have a very nice notebook to describe your idea
and the live code all in one document. Thus Jupyter notebook becomes really popular way to test ideas, writing
blogs, papers and even books, for example, this book is written entirely within Jupyter notebook. Of course, it has
many other advantages, and we will only cover the basics of the Jupyter notebook to get you started.
jupyter notebook
Then you will see the Jupyter notebook dashboard in the browser, the default address is: http://localhost:8888,
that is at the localhost with port 8888 as shown in the following figure (if the port 8888 is taken by other Jupyter
notebooks, then it will automatically use another port). This is essentially creating a local server to run in your
browser. When you navigate to the browser, you will see a dashboard. In this dashboard, you can see some
important features that labeled in red: you can see all the files in the current folder, show all the running
notebooks, and create a new notebook or others such as text file, folder and a terminal. We can create a new
Python notebook by selecting the Python 3, usually this is called Python kernel. You can use Jupyter to run some
other kernels as well, for example, in the following figure, there are Bash and Julia kernels that you could run as a
notebook, but you need to install them first. We will use the Python kernel, therefore, choose Python 3 kernel.
In the notebook, you can move the cell up or down, insert or delete cell, and so on. There are many other nice
features about Jupyter notebook, we won’t talk too much here, but you can find many tutorials online to learn
more.
Close a notebook
When you close the notebook browser tab, the notebook actually is not closed, it is still running in the
background. If you need completely close a notebook, go to the dashboard, and check the box before the
notebook, and you can see a shutdown option in the toolbar above, this is the correct way you close a notebook
completely.
Ok, now you have the basic knowledge to launch and run a Jupyter notebook, and it is time to continue to learn
Python.
< 1.3 Managing Packages | Contents | 1.5 Logical Expressions and Operators >
© Copyright 2020.