Jupyter Notebook || Installation, Tips and Tricks
- thecreator_hr
- Feb 20, 2020
- 3 min read
The Jupyter Notebook
"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 modelling, data visualization, machine learning, and much more", jupyter.org.

So, what is a "notebook," exactly? A notebook integrates code and its output into a single document, combining visualizations, narrative text, mathematical equations, and other rich media. This intuitive workflow facilitates iterative and rapid growth, making notebooks a growingly popular choice at the heart of contemporary data science, research, and science at large.
The Jupyter Notebook is the first choice for every Data Science and Machine Learning enthusiast, and it proves to be so by having an excellent interface, and light processing power.
It is the successor of the IPython Notebook first launched in 2010. The best thing about being open source is that it is free for all. Although Jupyter Notebook is capable of running many languages, still it is majorly used for coding in Python.
Installation
Installation of Jupyter Notebook is quite simple; you need to type in (Python must be already installed and put in the path variables):
This command should install Jupyter Notebook on your computer, and then you are ready to write your first code on Jupyter Notebook.
If you are using any Packaged Python Distribution such as Anaconda then most probably you already have it installed on your computer.
Congratulations!! you have successfully started your journey towards becoming a software developer.
TIPS AND TRICKS
Running each Cell
Some times each time using the cursor for running each cell is quite annoying, and it decreases productivity. Thus to save your precious time press "Shift + Enter" to execute each cell. When one presses the keys, the cursor moves to the next cell, or if no cell is available, it creates a new one.
Adding information about each Function
It is always the best practice to write readable code with most descriptive and concise comments that explain the entire code so that anyone can understand why the specific code has been written. (“Who knows if you yourself forget what you wrote and why”).
Writing a well-documented code is always good practice for software engineers. First of all, it is easier to debug and easily understandable.
Use the multiline comment (""" """) to write information about a function that you are making. Start with the function name, return value and a concise one or two lines about what the function does.
This makes anyone using your code to know what exactly is the use of your function. Then start defining every function argument and return values with their data types.
Seeing the Function Arguments
Now that you have written the comments below the function write the function name, then in the parentheses press “Shift + Tab”.
This will reveal the first line of multi-line comments that you have written. If you press “Shift + Tab + Tab”, it will reveal the whole multi-line comment paragraph.
This is most helpful if you want to see the sequence of parameters of a function. (Of course who remembers the sequence of parameters of a function.)
This is called Docstring (documentation) for the code.
Markdowns
Jupyter allows you to make your documentation more beautiful and readable by allowing you to use Markdowns.
To use Markdowns in command mode:
Press “M” to change the current cell to Markdown
Press “Y” to change it back to code.
Shortcut to Shortcuts
Press “Ctrl + Shift + P” get into the dialog box that helps you run any command by name – useful if you don’t know the keyboard shortcut for an action or if what you want to do does not have a keyboard shortcut. Once you start using it you’ll wonder how you lived without it!
Some more Tips and Tricks
While in command mode:
Press “A” to insert a new cell above the current cell.
Press “B” to insert a new cell below the current cell.
“D + D” (press the key twice) to delete the current cell.
“Enter” will take you from command mode back into edit mode for the given cell.
“Ctrl + Shift + ‘-’ ” will split the current cell into two from the place where your cursor is resting.
“Esc + F” Find and replace on your code but not the outputs.
“Esc + O“ Toggle cell output.
Select Multiple Cells:
“Shift + J” or “Shift + Down” selects the next cell in a downwards direction. You can also select cells in an upwards direction by using “Shift + K” or “Shift + Up”.
Once cells are selected, you can then delete / copy / cut / paste / run them as a batch. This is helpful when you need to move parts of a notebook.
You can also use “Shift + M” to merge multiple cells.
PS: For more shortcuts “Help > Keyboard Shortcuts”, or by pressing “H” in command mode. Every time you update Jupyter new shortcuts are added.
Comments