Getting started with Jupyter Notebook

Getting started with 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 & narrative text. Uses include data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning...

Originally published by https://www.geeksforgeeks.org

Jupyter has support for over 40 different programming languages and Python is one of them. Python is a requirement (Python 3.3 or greater, or Python 2.7) for installing the Jupyter Notebook itself.

Install Jupyter using Anaconda:

Install Python and Jupyter using the Anaconda Distribution, which includes Python, the Jupyter Notebook, and other commonly used packages for scientific computing and data science. You can download Anaconda’s latest Python3 version from here.

Now, install the downloaded version of Anaconda.

Installing Jupyter Notebook using PIP:
python3 -m pip install --upgrade pip
python3 -m pip install jupyter
Command to run the Jupyter notebook:
jupyter notebook

This will print some information about the notebook server in your terminal, including the URL of the web application (by default, http://localhost:8888) and then open your default web browser to this URL.

When the notebook opens in your browser, you will see the Notebook Dashboard, which will show a list of the notebooks, files, and subdirectories 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.

Create a new Notebook:

Now on the dashboard, you can see a new button at the top right corner. Click it to open a drop-down list and then if you’ll click on Python3, it will open a new notebook.

Few Useful Commands:
  • Command to open a notebook in the currently running notebook server.
jupyter notebook notebook_name.ipynb
  • By default, the notebook server starts on port 8888. If port 8888 is unavailable or in use, the notebook server searches the next available port. You may also specify a port manually. In this example, we set the server’s port to 9999:
jupyter notebook --port 9999
  • Command to start the 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
Running your First code in Jupyter:

Step #1: After successfully installing Jupyter write ‘jupyter notebook’ in the terminal/command prompt. This will open a new notebook server on your web browser.

Step #2: On the top left corner, click on the new button and select python3. This will open a new notebook tab in your browser where you can start to write your first code.

Step #3: Press Enter or click on the first cell in your notebook to go into the edit mode.

Step #4: Now you are free to write any code.

Step #5: You can run your code by pressing Shift + Enter or the run button provided at the top. An example code is given below:

Some useful keyboard shortcuts:
  • To change modes(edit, command):
Esc - Change mode to command mode
Enter - Change mode to edit mode
  • To change content type(code or markdown) [in command mode]
m - Change to markdown
y - Change to code
  • To execute code or markdown [any mode]
Shift + Enter - Execute and go to next cell
Ctrl + Enter  - Execute and be in the same cell
  • To insert cell [in command mode]
a - Create cell in above to the cell
b - Create cell in below to the cell
  • To cut copy paste [in command mode]
x - Cut the cell that can be paste anywhere any number of times
c - Copy the cell that can be paste anywhere and any number of times
v - Paste the cell

Thanks for reading

If you liked this post, share it with all of your programming buddies!

Follow us on Facebook | Twitter

Further reading

Beginner's Guide to Jupyter Notebooks for Data Science

Guide to R and Python in a Single Jupyter Notebook

Step-by-Step Guide to Creating R and Python Libraries (in JupyterLab)





Machine Learning, Data Science and Deep Learning with Python

Machine Learning, Data Science and Deep Learning with Python

Complete hands-on Machine Learning tutorial with Data Science, Tensorflow, Artificial Intelligence, and Neural Networks. Introducing Tensorflow, Using Tensorflow, Introducing Keras, Using Keras, Convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), Learning Deep Learning, Machine Learning with Neural Networks, Deep Learning Tutorial with Python

Machine Learning, Data Science and Deep Learning with Python

Complete hands-on Machine Learning tutorial with Data Science, Tensorflow, Artificial Intelligence, and Neural Networks

Explore the full course on Udemy (special discount included in the link): http://learnstartup.net/p/BkS5nEmZg

In less than 3 hours, you can understand the theory behind modern artificial intelligence, and apply it with several hands-on examples. This is machine learning on steroids! Find out why everyone’s so excited about it and how it really works – and what modern AI can and cannot really do.

In this course, we will cover:
• Deep Learning Pre-requistes (gradient descent, autodiff, softmax)
• The History of Artificial Neural Networks
• Deep Learning in the Tensorflow Playground
• Deep Learning Details
• Introducing Tensorflow
• Using Tensorflow
• Introducing Keras
• Using Keras to Predict Political Parties
• Convolutional Neural Networks (CNNs)
• Using CNNs for Handwriting Recognition
• Recurrent Neural Networks (RNNs)
• Using a RNN for Sentiment Analysis
• The Ethics of Deep Learning
• Learning More about Deep Learning

At the end, you will have a final challenge to create your own deep learning / machine learning system to predict whether real mammogram results are benign or malignant, using your own artificial neural network you have learned to code from scratch with Python.

Separate the reality of modern AI from the hype – by learning about deep learning, well, deeply. You will need some familiarity with Python and linear algebra to follow along, but if you have that experience, you will find that neural networks are not as complicated as they sound. And how they actually work is quite elegant!

This is hands-on tutorial with real code you can download, study, and run yourself.

Python For Data Science - How to use Data Science with Python

Python For Data Science - How to use Data Science with Python

This Edureka video on 'Python For Data Science - How to use Data Science with Python - Data Science using Python ' will help you understand how we can use python for data science along with various use cases. What is Data Science? Why Python? Python Libraries For Data Science. Roadmap To Data Science With Python. Data Science Jobs and Salary Trends

This Edureka video on 'Python For Data Science - How to use Data Science with Python - Data Science using Python
' will help you understand how we can use python for data science along with various use cases. Following are the topics discussed this Python Data Science Tutorial:

  • What is Data Science?
  • Why Python?
  • Python Libraries For Data Science
  • Roadmap To Data Science With Python
  • Data Science Jobs and Salary Trends
  • How Edureka Helps?

Best Python Libraries For Data Science & Machine Learning

Best Python Libraries For Data Science & Machine Learning

Best Python Libraries For Data Science & Machine Learning | Data Science Python Libraries

This video will focus on the top Python libraries that you should know to master Data Science and Machine Learning. Here’s a list of topics that are covered in this session:

  • Introduction To Data Science And Machine Learning
  • Why Use Python For Data Science And Machine Learning?
  • Python Libraries for Data Science And Machine Learning
  • Python libraries for Statistics
  • Python libraries for Visualization
  • Python libraries for Machine Learning
  • Python libraries for Deep Learning
  • Python libraries for Natural Language Processing

Thanks for reading

If you liked this post, share it with all of your programming buddies!

Follow us on Facebook | Twitter

Further reading about Python

Complete Python Bootcamp: Go from zero to hero in Python 3

Machine Learning A-Z™: Hands-On Python & R In Data Science

Python and Django Full Stack Web Developer Bootcamp

Complete Python Masterclass

Python Tutorial - Python GUI Programming - Python GUI Examples (Tkinter Tutorial)

Computer Vision Using OpenCV

OpenCV Python Tutorial - Computer Vision With OpenCV In Python

Python Tutorial: Image processing with Python (Using OpenCV)

A guide to Face Detection in Python

Machine Learning Tutorial - Image Processing using Python, OpenCV, Keras and TensorFlow

PyTorch Tutorial for Beginners

The Pandas Library for Python

Introduction To Data Analytics With Pandas