Jupyter Notebooks

getting started with jupyter notebooks

learn how to create jupyter notebooks and how to work on them in python 3

Introduction
Jupyter notebook is a webapp which allows us to run python code , visualizations etc inside of the browser , the files or notebooks created using the Jupyter notebook app can be shared across network and they're easily reproducible. Jupyter notebooks support not only python but many other language also. All these features of notebooks along with others have gained Jupyter notebooks a lot of popularity amongst data science and machine learning enthusiasts to share research , code snippets etc. In this tutorial we learn how to install Jupyter on ubuntu and how to get started with a simple python3 notebook.
Install Jupyter
before installing Jupyter ensure , that you've the following prerequisites in place :
  1. Python ( both 2 and 3 supported , using 3 in this tutorial )
  2. pip3 / pip
Once you have the above dependencies met , launch the following command in your terminal window on ubuntu machine.


sudo pip3 install jupyter  



This installs jupyter on your machine. Now just navigate to the directory where you would like to start creating jupyter notebooks and start the jupyter notebook


cd ~/my_jupyter_notebooks

jupyter notebook 

the output of the above should inclue the following amongst other lines


Serving notebooks from local directory: ~/my_jupyter_notebooks 

The Jupyter Notebook is running at: http://localhost:8888/?token=5b6735f39006b3c1167obfuscatedaaa14c8b0d0431d26e2

Use Control-C to stop this server and shut down all kernels (twice to skip confirmation



now just navigate to the url you see in the output as shown above in your browser and you should see the notebook app running as shown in the screenshot.


getting started with jupyter notebook
Congratulations! your jupyter notebook webapp is working now. Let's move ahead and create our first notebook. Just click on the new dropdown and click on Python 3 as shown in the screenshot below. When you click on Python 3 it takes you to a new tab where you can start editing your notebook. getting started with jupyter notebook Just enter some python code in the editor line and hit ctrl + enter , it executes our code , prints the output [ if any ] and takes us to the next line as shown below.
getting started with jupyter notebook
Now we can keep on adding new lines of code and the output is reflected in the browser itself just by hitting ctrl + enter
When you're done with your code work you can save your work using the save option and resume it later on from the same point where you left off. You can also share your work with others in different formats.
Summary
In this short and quick tutorial on jupyter notebooks , we learned how to created a simple jupyter notebook. The language we used in this tutorial is Python 3 , but jupyter can be used with other language as well. If you're interested to explore more on jupyter notebooks , feel free to look at the Jupyter docs :: Jupyter Docs



More from RISHABH.IO





developed & nourished with by rishabh.io