summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2025-04-11 09:48:04 -0600
committerChristian Kolset <christian.kolset@gmail.com>2025-04-11 09:48:04 -0600
commitcbb3abe483487630f16a4b07beda9e28efc51f10 (patch)
tree99db9149c92381cf468b53ceec21c3cb631d585f
parentb7deaf3ce1e50a670384fff6ada288f7cd4b5260 (diff)
Added jupyter lab/notebook tutorial to module 1
-rw-r--r--tutorials/module_1/1_jupyter_lab_notebook.md105
1 files changed, 105 insertions, 0 deletions
diff --git a/tutorials/module_1/1_jupyter_lab_notebook.md b/tutorials/module_1/1_jupyter_lab_notebook.md
new file mode 100644
index 0000000..5fa493a
--- /dev/null
+++ b/tutorials/module_1/1_jupyter_lab_notebook.md
@@ -0,0 +1,105 @@
+## Introduction
+
+
+Jupyter Notebooks are often used for data science and scientific computing such as machine learning as the interactive design allow you to experiment easily with your code. For our purpose, we will use Notebooks as it's a useful tool to learn how to code as well as writing reports.
+
+*Note on the difference between Notebook and Lab: Jupyter Notebook offers a simplified, lightweight notebook authoring experience, where as, JupyterLab offers a feature-rich, tabbed multi-notebook editing environment with additional tools like a customizable interface layout and system console*
+
+
+---
+## Setup and Installation
+Installing with Conda using CLI:
+- `conda install jupyter`
+Jupyter can also be installed using a Anaconda Navigator
+
+ - Launching:
+ - From terminal: `jupyter notebook` or `jupyter lab`
+ - From Anaconda Navigator or VSCode
+ - Navigating the interface:
+ - Tabs and file browser
+ - Kernel and terminals
+
+---
+
+## Notebook Basics
+- Creating a new notebook (`.ipynb`)
+- Types of cells:
+ - Code
+ - Markdown
+ - Raw
+- Running a cell: `Shift + Enter`
+- Adding/removing cells
+- Restarting the kernel
+- Saving and auto-checkpoints
+
+---
+
+## Writing and Running Code
+- Python syntax:
+ - `print("Hello, world!")`
+ - Variables and functions
+ - Loops and conditionals
+- Importing libraries:
+ - `import numpy as np`
+ - `import pandas as pd`
+ - `import matplotlib.pyplot as plt`
+
+---
+
+## Using Markdown
+- Headers: `#`, `##`, `###`
+- Bullet lists: `- item`
+- Numbered lists: `1. item`
+- Emphasis: _italic_, **bold**, `monospace`
+- LaTeX equations:
+ - Inline: `$E = mc^2$`
+ - Block: `$$\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$$`
+- Embedding links and images
+
+
+
+---
+## Interactive Widgets (optional)
+
+Install `ipywidgets` from your package manager
+
+```python
+import ipywidgets as widgets
+widgets.IntSlider()
+```
+Example using interact:
+
+```python
+from ipywidgets import interact
+interact(lambda x: x**2, x=5)
+```
+
+
+---
+## Productivity Tips
+Here are some keyboard shortcuts to improve your productivity when writing in notebooks.
+
+| Key | Action |
+| --- | ------------------ |
+| A | insert cell above |
+| B | insert cell below |
+| M | switch to Markdown |
+| Y | switch to code |
+ Magic commands:
+- `%timeit`, `%matplotlib inline`, `%%bash`
+Splitting and merging cells
+Auto-save behavior
+
+---
+
+## Exporting and Sharing
+ - File > Download As:
+ - Notebook (`.ipynb`)
+ - HTML
+ - PDF (requires LaTeX)
+ - Markdown
+- Notebooks can be saved and shared via the following services:
+ - GitHub
+ - nbviewer.org
+ - mybinder.org
+ - JupyterHub \ No newline at end of file