Skip to content

Commit

Permalink
Added jupyter intro
Browse files Browse the repository at this point in the history
  • Loading branch information
cuihantao committed Sep 26, 2024
1 parent eb47d8b commit ab1d184
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 1 deletion.
1 change: 1 addition & 0 deletions pct/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ chapters:
- file: modules/01/filesystem.md
- file: modules/01/pkgman.md
- file: modules/01/env.md
- file: modules/01/jupyter.ipynb
- file: notebooks
- file: markdown-notebooks
2 changes: 1 addition & 1 deletion pct/modules/01/intro.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Fundamentals in Tooling
# Tools You Need

## Motivation

Expand Down
117 changes: 117 additions & 0 deletions pct/modules/01/jupyter.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Jupyter Notebook\n",
"\n",
"## Why use Jupyter?\n",
"\n",
"Jupyter is an open-source, web-based interface for interactive computing.\n",
"Jupyter Notebook is Jupyter's document format that can store live code,\n",
"equations, visualizations, and text. These documents can be shared for\n",
"reproducible research and published online. This book you are reading is written\n",
"in Jupyter Notebook.\n",
"\n",
"Jupyter supports many programming languages, including Python, Julia\n",
"and R. Since the primary language of this training is Python, we will use\n",
"Jupyter for it.\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Install Jupyter\n",
"\n",
"### Jupyter Notebook\n",
"If you have followed through the previous section, you should have already\n",
"installed Jupyter Notebook. If not, you can install it by\n",
"\n",
"```bash\n",
"# activate your conda environment\n",
"\n",
"# install jupyter notebook\n",
"mamba install jupyter notebook\n",
"```\n",
"\n",
"\n",
"You can launch Jupyter Notebook by\n",
"\n",
"```bash\n",
"jupyter notebook\n",
"```\n",
"\n",
"The command line will print a URL that you can open in your web browser to\n",
"access. If the web browser does not open automatically, you can hold down Ctrl\n",
"and click on the URL, or copy and paste the URL into your web browser.\n",
"\n",
"This is the classical Jupyter Notebook interface.\n",
"\n",
"\n",
"### JupyterLab\n",
"\n",
"Jupyterlab is the modern web interface for Jupyter. It is more powerful by\n",
"allowing multiple notebooks to be edited in the same browser window. You will\n",
"find it much more convenient to use. \n",
"\n",
"You can install JupyterLab by\n",
"\n",
"```bash\n",
"mamba install jupyterlab\n",
"```\n",
"\n",
"You can launch JupyterLab by\n",
"\n",
"```bash\n",
"jupyter lab\n",
"```\n",
"\n",
"## Tour of Jupyter Notebook and JupyterLab\n",
"\n",
"The official Jupyter website contains two brief tours:\n",
"\n",
"- [Jupyter Notebook Tour](https://jupyter.org/try-jupyter/notebooks/?path=notebooks/Intro.ipynb)\n",
"- [JupyterLab Tour](https://jupyter.org/try-jupyter/lab/index.html)\n",
"\n",
"Please visit each of them. After the page loads, you will see a message at the\n",
"lower right corner, saying \"Try the Notebook Tour\" or \"Try the Welcome Tour.\".\n",
"Click \"Start Now\" to begin the tour. \n",
"\n",
"## Shortcuts\n",
"\n",
"Learning to use shortcuts can significantly increase your productivity! Here are\n",
"some shortcuts to start with:\n",
"\n",
"1. When you are editing a cell, press `esc` to exit edit mode.\n",
"2. When you are NOT editing a cell, you can use arrow keys to move around.\n",
" Alternatively, you can use `j` and `k` to move between cells. `j` and `k`\n",
" reduces the travel distance of the hand compared to arrow keys.\n",
"3. To edit a cell, move the focus there and press `Enter`.\n",
"3. You can insert a cell using `b` (below) or `a` (above).\n",
"4. You can delete a cell using `dd`.\n",
"5. You can run a cell using `Shift+Enter`. This will run the cell and move the\n",
" focus to the next cell. If this is the last cell, a new one will be inserted.\n",
"6. Merge a cell with the cell below it using `Shift+M`.\n",
"7. To split a cell into two, move the focus to the line where you want to split,\n",
" then press `Ctrl+Shift+Minus(-)`. Think of that `-` as a separator.\n",
"8. To change a cell from code to markdown, press `m`. To change it back to code,\n",
" press `y`.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit ab1d184

Please sign in to comment.