Starter template for the First Python Notebook tutorial and assignment.
IMPORTANT: We'll be using a different coding workflow than the one used in the official tutorial. Therefore, please follow the setup instructions below and, once complete, begin your work with Chapter 3 - pandas.
The below instructions are for working in GitHub Codespaces with Jupyter and the uv package management tool. See this screencast on Jupyter and Codespaces and others in this YouTube series for help on various aspects of working in this context.
To set up your coding environment on Codespaces for this assignment, follow these steps:
- Go to the GitHub repository page for this assignment
- Click the green
Codebutton and open a GitHub Codespace - Once the Codespace is running, go to the Extensions area in the left side navigation and install the Python and Jupyter extensions
- Open a Terminal shell and run the following commands (one at a time) in the shell. Hit
return/enterafter each of the below commands:pipx install uvuv inituv add jupyter ipykernel pandas altair
- Using the File menu, create a new Jupyter notebook called
first_python_notebook.ipynb - In the upper right of the notebook, click
Select kernel, then choosePython environmentsand select the kernel/environment that is tied to your "uv" environment. Typically this should be named after the repo plus your GH username and has a.venv/bin/pythonpath at the end. The environment may also be starred as the recommended choice. - Test your setup by creating a code cell in the notebook, typing
import pandas as pd, and hit the play button to the left of the cell (orshift + enter). If you see a green check mark, you should be good to go. If not, reach out to an instructor for help debugging.
Remember that in Codespaces, you must commit (aka save) and push your work back to GitHub so that your instructors can view the code. Watch this video if you need a refresher on saving and submitting your work.
IMPORTANT: You should regularly save and push your work, even if it is not completed. That way you avoid losing work if something goes wrong with the Codespace (it happens). And you should definitely always save your work before exiting out of the Codespace, again, even if the work is not yet complete.