Python Environment
Create A Notebook
In your GitHub Codespace:
Do this in your personal HDSx-workspace fork — the same Codespace you use for assignments, not the read-only course-book repository or a blank repo.
- In the Explorer, select
assignments/assignment04-polyglot/submission/. - Right-click that folder, choose New File…, and name the file
translation.ipynb. Do not save it at the repository root. - Select the recommended Python kernel when VS Code asks.
- Before running anything, let the Codespace finish setting up. If VS Code shows an “Updating extensions” or “Installing extensions” message in the bottom-right corner, wait for it to finish — running the notebook before the Python and Jupyter extensions are up to date can make the first cell very slow to start. You can confirm in the Extensions panel that the Python and Jupyter extensions are installed and not showing a pending update.
- Run this first cell by clicking the play button to the left of the cell (or pressing
Shift+Enter). The output appears directly below the cell:
Use The Variables Pane
The Variables pane helps you audit Python objects the way the Environment pane helps you audit R objects.
Run this cell:
Then open the notebook Variables pane and check that both variables appear.
Load A Tiny DataFrame
pandas comes preinstalled in the course Codespace, so the import below just works — you do not need to install anything.
Double-click demo in the Variables pane to open the Data Viewer. This is where you will inspect row counts, column names, and translated outputs later in the week.
Common Fixes
| Problem | First thing to try |
|---|---|
| No kernel appears | Wait for the Codespace to finish starting, then reload the window |
| Variables pane is missing | Check that the Jupyter extension is enabled |
| Notebook cell will not run | Select a Python kernel from the notebook toolbar |
| First cell is very slow to start | Wait for the Python and Jupyter extensions to finish updating (check the Extensions panel), then try again |
| Package import fails | Check the course baseline in .devcontainer/requirements.txt; ask before adding a package |