1. Getting Started with Python
and Jupyter Notebook
1. Launch Jupyter Notebook
2. Open a Notebook file
3. Start writing a Jupyter Notebook
4. Install other libraries to Anaconda
This document includes how to:
(For Windows users)
Plus I list some Python and Jupyter learning resources!
2. 1. How to launch Jupyter Notebook
There are 3 ways to launch Jupyter Notebook:
1) Using Anaconda Navigator
a) Open the application called Anaconda Navigator (this may take a couple of
minutes)
b) Click on “Launch” in the
Jupyter Notebook box
3. 1. How to launch Jupyter Notebook
2) Using Anaconda Prompt
a) Open the application called Anaconda Prompt
b) Type “jupyter notebook” (without quotes) and hit the return key
Type
“jupyter notebook”
here
Note: your Anaconda Prompt window will show a different pathname than in this image, but it will look similar!
4. 1. How to launch Jupyter Notebook
3) Clicking on the Jupyter Notebook App
in the Start Menu (I just learned about
this method, and it will probably be the
fastest!)
5. 1. How to launch Jupyter Notebook
You will know that
Jupyter Notebook
opened correctly if you
see a page similar to
this one open in your
browser!
6. 2. How to open a Notebook file
• Navigate through your
folders until you get to
the directory you want
to save your scripts in.
• You can navigate
through by clicking on
the name of the Folder.
For example: click
“Documents”
Your current path
is shown here
List of files in
current directory
7. 2. How to open a Notebook file
• Open a new Notebook
file by clicking on the
“New” menu on the
upper right
8. 2. How to open a Notebook file
• Open a previously saved
Notebook file by clicking
on the name of the file
• The extension for a
Jupyter Notebook file is
“.ipynb”, which is short
for “interactive python
notebook”
9. 3. How to start writing a Jupyter Notebook
A new Notebook looks like this:
First, click on “Untitled” to name your script.
Click here to name
your script
This cell is where you
write code!
10. 3. How to start writing a Jupyter Notebook
• It’s good practice to start your script by importing libraries you will need.
• Below are three libraries I often use, but you may need different ones.
• For a brief description of these libraries, take a look at the lecture slides from Dr. Paige’s
Python lecture at the 2019 COESSING school (either under the Resources tab or the
Monday section of the 2019 page on the website)
If there is a number here, then the cell has been evaluated! This means that the code written
in that cell has been run. A cell is evaluated by either clicking “Run” or by typing Shift+Return.
Click here to
evaluate the cell
11. 4. How to install other libraries to Anaconda
There are some libraries that my be useful (and some we used in the COESSING labs!) that
do not come with Anaconda. But, we can install them directly to our conda library!
There are two methods to install these libraries:
1. Open Anaconda Prompt
2. Open a “Terminal” instance from Jupyter Notebook (see below image for instructions!)
12. 4. How to install other libraries to Anaconda
With either method, you will see something like this:
To download the packages we used in the COESSING 2019 courses, type the following into
your terminal or Anaconda Prompt window and hit Return (type ‘y’ when prompted):
This is to load netcdf data
This is to make pretty maps
This is to do tidal analysis
13. 4. How to install other libraries to Anaconda
Once the libraries are installed once, you never have to install again and you can just import
them at the top of your script!
14. Hopefully this gives you a good start to
Python coding in Jupyter Notebook!
There a LOTS of good Python and/or Jupyter resources online. On the next slide I list a few
resources that I really like, but you can also search for yourself! Especially if you are using
a specific library, you can Google search for that specifically! (For example, if you want to
use Basemap, search for “Basemap tutorial”.) These are also listed on the Resources tab
of the coessing.org website. These are all free resources except where stated.
15. Python and Jupyter Resources!!
Good websites with a lot of resources!
GREAT Python learning resource - https://realpython.com/start-here/
- You can read tutorials, watch instructional videos, and take quizzes to assess your knowledge.
Another good resource – you can do first chapter of all courses free. Has really nice cheatsheets! - https://www.datacamp.com
- I’ve included some of the cheat sheets that I think will be most useful on the website!
Nice interactive introduction to python – you can run short python scripts in your browser as you go through the lesson! –
https://www.learnpython.org/en/Welcome
Text tutorials: Intro to Jupyter Notebook and Python
Jupyter Notebook for Beginners: A Tutorial - https://www.dataquest.io/blog/jupyter-notebook-tutorial/
Jupyter Notebook: An Introduction - https://realpython.com/jupyter-notebook-introduction/
First Steps With Python - https://realpython.com/python-first-steps/
Videos: How to open/use Jupyter Notebook (and Python)
Jupyter Notebook Tutorial: Introduction, Setup, and Walkthrough - https://www.youtube.com/watch?v=HW29067qVWk
Python Jupyter Notebook | Simplilearn - https://www.youtube.com/watch?v=3C9E2yPBw7s
Getting Started With Jupyter Notebook for Python - https://www.youtube.com/watch?v=CwFq3YDU6_Y
Video: Python plotting in Jupyter Notebook – https://www.youtube.com/watch?v=Hr4yh1_4GlQ
Online courses: you can take Python courses (or any other course they offer!) for free, but you must pay to get a verified certificate and to have
your exercises graded
Coursera - https://www.coursera.org
EdX - https://www.edx.org