What is Jupyter Notebook
If you’re a Python developer, or someone who has to interact with Python, you may be hearing or seeing the term Jupyter Notebook quite lot, while reading articles, or looking for some solution on-line.
The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, machine learning and much more.
In simple words, Jupyter Notebook allows you to have your code, and text elements (doc, mathematical equations, images, or links, etc.) in a single file. These files are called notebooks, and the best part about them is, they are both, a human-readable file with code, the result of the interpretor session, analysis results, supporting figures, and as well as an executable file, that you can run the code in them and have the result right-away.
The Jupyter Notebook was earlier called iPython Notebook, as it was built on top of iPython. The dropped the word Python, as the Notebook now can load various other languages i.e. Python 2.x, 3.x, R, Julia, Ruby, etc.
Jupyter comes installed with Anaconda distribution. If you’re not using the Anaconda distribution, you can install Jupyter quite easily.
Installing Jupyter on CentOS 7.x
As it’s dependency Jupyter will install notebook package, which as it’s dependency will install ipython.
Note: latest ipython 6.x will work with Python 3.3 or higher, for lower version – Python 2.7 use ipython 5.x.x
pip install ipython==5.0.0
pip install jupyter
Start the jupyter kernel
Simple hit ‘jupyter notebook‘ at your project root – folder which has/will have the notebooks. It will then open your default web browser to http://localhost:8888 – the default port.
When the notebook opens in your browser, you will see the Notebook Dashboard, which will show a list of the notebooks, files, and sub-directories in the directory where the notebook server was started. Most of the time, you will wish to start a notebook server in the highest level directory containing notebooks. Often this will be your home directory.
Start Jupyter Notebook using not the default port 8888 (in case it’s already in use)
jupyter notebook --port 9999
Start notebook server without opening a web browser
jupyter notebook --no-browser
The notebook server provides help messages for other command line arguments using the –help flag:
jupyter notebook --help
Launching/creating your first Jupyter (iPython) Notebook
in right corner click the ‘New’ dropdown