0a: Python, Notebooks, and the Course Workflow
Python and the tools we use let us make our workflows into research evidence.
We are learning a carefully curated subset of Python to use modern research tools to get reproducible results, verifiable procedures, and sharable artifacts.
Python foundations
Notebooks, Markdown, basic syntax, and the first working habits.
Polars
Read, inspect, transform, and save research data.
Projects
Git, GitHub, Codespaces, and environment management.
Quarto outputs
Documents, manuscripts, slides, and code-generated results.
Core focus: Python interpreter, notebooks, variables, strings, numbers, lists, dictionaries, packages, and documentation.
Core focus: reading data, inspecting structure, transforming columns, merging, querying, and writing results.
Supporting focus: functions, loops, reusable patterns, readable code, and handling errors without panic.
Warning sign: useful, but lower ROI for most research workflows.
Examples: classes and inheritance, package development, testing and continuous integration, cross-version support, open-source contributions.
Packages are tools. Research projects need the right tools, in compatible versions, kept together with the project.
We use devcontainers and environments as recipes that we can ship with the project, so we can reproduce the computing environment later, on another computer, or for a coauthor.
GitHub Codespaces gives everyone the same working environment in the browser.
The devcontainer defines the Python version, Quarto, VS Code extensions, and course packages as project infrastructure rather than one-off setup steps.
That matters for research because things change: coauthor writing code or verifying results, another computer, new computer, OS upgrade, and so on.
The explanation, code, and results live near each other. That makes the notebook useful for planning, decision-making, doing, outputting, and sharing.
Programming languages are very literal. They attempt to evaluate exactly what we give them.
The best part is that they do exactly what we say. The worst part is that they do exactly what we say.
It’s fine. They make us resolve ambiguity, and they tell us exactly what is wrong. We can read the error, fix it, and move on. And repeat. A lot.
Open notebooks/0a_intro.ipynb.