Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 61 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,68 @@
## Python & Jupyter Basics
# Student Guide: Jupyter Notebook Activities and Project

This project walks you through some basic activities in Python through some activities and a project.
Welcome! This guide will help you set up your environment, complete the activities, and work on the project exercises. Please follow the steps below carefully.

### Topics
---

The goal is for you to get familiar with Jupyter Notebooks, and also get familiar with some basic concepts in Python such as:
## 1. Setting Up Codespace for Jupyter Notebook

### Prerequisites
1. A GitHub account.
2. Basic familiarity with using GitHub and Codespaces.

### Steps to Create a Codespace
1. **Open Repository**: Navigate to this repository in your GitHub account.
2. **Create Codespace**: Click the `Code` button, select the `Codespaces` tab, and then click `Create codespace on main`.
3. **Install Jupyter Notebook Extension**:
- Once the Codespace is open, go to the **Extensions** view (on the sidebar, look for the square icon with four boxes).
- Search for **Jupyter Notebook** (developed by Microsoft) and install it.
4. **Set Kernel to Python Environment**:
- Open any `.ipynb` file from the repository in the Codespace.
- At the top-right corner of the Jupyter Notebook interface, click on the `Kernel` dropdown.
- Select the Python environment created in your Codespace (e.g., `Python 3 (ipykernel)`).
- This will ensure your notebooks are ready to run Python code.

---

## 2. Activities

### Overview
Before diving into the project exercises, it's essential to complete the activities. These activities are designed to familiarize you with the basics of Jupyter Notebook and Matplotlib.

### Available Activities
1. **Basics of Jupyter Notebook**: Learn how to navigate and write basic Python code in Jupyter Notebook.
- File: `activities/1.1-basic-jupyter-notebook.ipynb`
2. **Introduction to Matplotlib**: Explore Matplotlib and create basic visualizations.
- File: `activities/1.2-using-matplotlib.ipynb`

### Steps to Complete Activities
1. Open the activity files from the `activities` folder in your Codespace.
2. Follow the instructions provided in the notebook cells.
3. Experiment with the examples and try out additional code as needed.

---

## 3. Project: Exercises on Matplotlib

### Overview
The project file contains a set of exercises related to Matplotlib. These exercises build on the skills you developed in the activities and are meant to test your understanding and creativity.

### Steps to Complete the Project
1. Open the project file:
- File: `project/project.ipynb`
2. Carefully read the instructions for each exercise.
3. Complete the exercises by writing your solutions in the code cells provided.

---

## 4. Submitting Your Work

### Submission Guidelines
1. Save your completed project file with all solutions in the `src` folder.
- Recommended filename: `matplotlib_exercises_solution.ipynb`.
2. Ensure all cells are executed, and outputs are visible in the notebook.
3. Push your updated `src` folder to the repository.

- Operations
- Functions
- Conditionals
- Dictionaries
- Lists
- File Handling
- Basic Plotting

### Goal

Expand Down
167 changes: 167 additions & 0 deletions activities/1.1-basic-jupyter-notebook.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "f054f174",
"metadata": {},
"source": [
"# Welcome to JupyterLab\n",
"\n",
"In this activity, you will get hands-on experience with the basics of JupyterLab. By the end of this notebook, you will be able to:\n",
"\n",
"1. Create and run code cells.\n",
"2. Use Markdown cells for adding text.\n",
"3. Explore JupyterLab's interface and shortcuts.\n",
"4. Save and export your notebooks.\n",
"\n",
"Let’s get started!\n"
]
},
{
"cell_type": "markdown",
"id": "0bb6bbdd",
"metadata": {},
"source": [
"## 1. Running Code in JupyterLab\n",
"JupyterLab allows you to write and execute Python code interactively. Code cells are the building blocks of notebooks.\n",
"\n",
"### Activity\n",
"Run the Python code below by selecting the cell and pressing **Shift + Enter** (or clicking the Run button in the toolbar)."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "f2b4273a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello, JupyterLab!\n"
]
}
],
"source": [
"# This is a Python code cell\n",
"print('Hello, JupyterLab!')"
]
},
{
"cell_type": "markdown",
"id": "dde499ca",
"metadata": {},
"source": [
"### Task\n",
"1. Modify the code above to print your name.\n",
"2. Run the cell again to see the output.\n"
]
},
{
"cell_type": "markdown",
"id": "59d7f0ea",
"metadata": {},
"source": [
"## 2. Adding Text with Markdown\n",
"Markdown cells allow you to add text, headings, lists, and more to your notebook.\n",
"\n",
"### Activity\n",
"1. Double-click this cell to edit it.\n",
"2. Add your name below using Markdown syntax:\n",
"\n",
"### Your Name\n",
"John Doe\n",
"\n",
"3. Press **Shift + Enter** to render the Markdown."
]
},
{
"cell_type": "markdown",
"id": "b5f27fd8",
"metadata": {},
"source": [
"## 3. JupyterLab Interface\n",
"The JupyterLab interface includes several useful components:\n",
"- **File Browser**: Navigate and manage files.\n",
"- **Notebook Tabs**: Work with multiple notebooks or files.\n",
"- **Toolbar**: Run cells, save notebooks, and more.\n",
"\n",
"### Activity\n",
"Explore the interface and try the following:\n",
"1. Locate the File Browser on the left-hand side.\n",
"2. Open a new Python 3 notebook (File > New > Notebook).\n",
"3. Close this new notebook without saving it.\n"
]
},
{
"cell_type": "markdown",
"id": "3dc36da6",
"metadata": {},
"source": [
"## 4. Keyboard Shortcuts\n",
"Keyboard shortcuts make working in JupyterLab more efficient. Here are some commonly used ones:\n",
"\n",
"- **Shift + Enter**: Run the current cell.\n",
"- **A**: Insert a new cell above.\n",
"- **B**: Insert a new cell below.\n",
"- **DD**: Delete the current cell.\n",
"- **M**: Convert a cell to Markdown.\n",
"- **Y**: Convert a cell to code.\n",
"### Activity\n",
"1. Practice these shortcuts by inserting a new cell below.\n",
"2. Change the cell type to Markdown and add a heading: `# JupyterLab Shortcuts`.\n",
"3. Run the cell to render it."
]
},
{
"cell_type": "markdown",
"id": "4a9f2188",
"metadata": {},
"source": [
"## 5. Saving and Exporting Notebooks\n",
"You can save your notebook using **Ctrl + S** or the save icon in the toolbar.\n",
"\n",
"Notebooks can also be exported to other formats like HTML or PDF:\n",
"1. Go to **File > Export Notebook As**.\n",
"2. Choose a format (e.g., HTML).\n",
"### Activity\n",
"Save this notebook and export it as an HTML file. Verify that the file is created in the File Browser."
]
},
{
"cell_type": "markdown",
"id": "3c27d308",
"metadata": {},
"source": [
"# Congratulations!\n",
"You have completed the basics of JupyterLab.\n",
"\n",
"In the next activity, we will explore Python Matplotlib libraries.\n",
"\n",
"Feel free to experiment with JupyterLab further to familiarize yourself with its features."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Empty file.
321 changes: 321 additions & 0 deletions activities/1.2-using-matplotlib.ipynb

Large diffs are not rendered by default.

60 changes: 0 additions & 60 deletions activities/1.3-using-matplotlib.ipynb

This file was deleted.

Loading