Learn how to ...
Follow the official instructions
Follow the official instructions
Follow the official instructions
Windows: launch Anaconda Prompt from the Start Menu. Mac: launch the Terminal app. Linux: launch a terminal.
At the command prompt, enter python and hit ENTER.
To exit Python, enter exit() and hit ENTER.
At the command prompt, execute conda create --name py37 python=3.7 jupyter
When prompted for yes or no, enter y
The command above does the following -
py37.jupyter library. This library will provide the Jupyter Notebook we will be using later.On Windows, Anaconda Prompt's command prompt always shows the current virtualenv in use. When the root environment is in use, it displays (base).
On Mac or Linux, the terminal will not show anything when root environment is used.
To change to our newly created environment, execute conda activate py37
To exit the current environment, execute conda deactivate
Activate our environment at the command prompt, and then execute jupyter notebook.
Click New on the upper RHS, and select Folder from the dropdown.
Check the folder to be renamed, click Rename on the upper LHS, and type new folder name WITHOUT SPACE.
Click on the folder you just created. Once inside, click New on the upper RHS, and select Python 3 from the dropdown.
Click on File and select Rename from the dropdown. Type in new name WITHOUT SPACE. Note: leave the folder name before the / alone.
Type in the first cell the following text and click on the Run button in the toolbar.
1 | print('Hello World')
|
conda, Anaconda's package manager.pip is another Python package manager.conda or pip. If its creator has uploaded the source code to Github, you can installed it from there.condaWe will install several libraries required for our workshop later - pandas, basemap and basemap-data-hires.
Make sure your environment is activated, and execute conda install pandas basemap basemap-data-hires
pipWe will install a library called 'Jupyter Themes'. It allows us to customize the look n' feel of Jupyter notebooks.
Make sure your environment is activated, and execute pip install jupyterthemes.
To list available themes, execute jt --list at the command prompt.
A simple setup using the popular Solarized Dark (solarizedd) theme with wide cell (less wastage of screen estate) and the toolbar, execute the following command:
jt -t solarizedd -cellw 90% -T
We will install a library called 'Turtle'. It allows us to draw lines and shapes in Jupyter notebook. It is a fun tool that helps us learn Python.
Note: Turtle is re-adaptation of the Logo language found on Apple Macintosh in early 1980's.
Go to https://github.com/takluyver/mobilechelonian, click on Clone or download, then Download ZIP.
Find the downloaded file (my browser saved it at C:\Users\Jia Li\Downloads) and unzip it.
Make sure your environment is activate. Change directory (cd) to where the unzipped files are. Then execute python setup.py install
Copy and paste the sample code on the library's Github page into a Jupyter notebook cell and then click Run to see the Turtle in action.
pip| Table of contents | t |
|---|---|
| Exposé | ESC |
| Autoscale | e |
| Full screen slides | f |
| Presenter view | p |
| Source files | s |
| Slide numbers | n |
| Blank screen | b |
| Notes | 2 |
| Help | h |