Lesson 0.1.3 · 25 min
Course structure, entry tests, personal repository and learning with AI
Eight levels, a repository that grows with you and clear rules for using AI assistants without giving up on learning. This lesson explains how to work through the course and what to have ready before module 0.2.
- Module
- 0.1 · Welcome and expectations
- Duration
- 25 min
- Author
- Jesús Cuesta
- Updated
Level 0 lessons
0.1 · Welcome and expectations
0.2 · Modern working environment
- 0.2.1 Installing Python with uv: versions and support cycle
- 0.2.2 Virtual environments and dependencies: uv init, uv add, pyproject.toml and lockfiles
- 0.2.3 Editors (VS Code, Cursor, PyCharm) and notebooks (Jupyter, JupyterLab, marimo)
- 0.2.4 Basic terminal, paths, environment variables and .env files
- 0.2.5 Git and GitHub: commits, branches, pull requests and .gitignore
- 0.2.6 Introduction to AI coding assistants: prompts, review and tests
0.3 · Language fundamentals
- 0.3.1 Variables, types and operators; floating point and decimal for prices and ticks
- 0.3.2 Strings, f-strings and formatting numbers and dates
- 0.3.3 Lists, tuples, dictionaries, sets and comprehensions
- 0.3.4 Control flow: if, elif, else, for, while and match-case
- 0.3.5 Functions: arguments, *args and **kwargs, lambdas and scope
- 0.3.6 Exceptions; modules and packages, with Python 3.15 lazy imports
0.4 · Intermediate Python
- 0.4.1 Object-oriented programming: classes, inheritance, composition and dataclasses
- 0.4.2 Typing: type hints, mypy or ty, and Pydantic for configurations
- 0.4.3 Iterators, generators, decorators and context managers
- 0.4.4 Files (CSV, JSON, YAML, TOML) and dates with time zones
- 0.4.5 Professional logging and testing with pytest
- 0.4.6 Concurrency: threading, multiprocessing, asyncio and free-threading
0.5 · Numerical computing and data
- 0.5.1 NumPy 2: arrays, broadcasting, vectorization, linear algebra and random generators
- 0.5.2 pandas 3.0: Series, DataFrame, time indexes, Copy-on-Write, the str type and pd.col()
- 0.5.3 Selection, filtering, groupby, merge, pivot, resample and moving windows
- 0.5.4 Polars: lazy versus eager API, expressions, performance and when to pick it over pandas
- 0.5.5 DuckDB and essential SQL: SELECT, JOIN, GROUP BY and window functions on Parquet
0.6 · Visualisation
0.7 · Minimum mathematics and statistics
Levels, modules and lessons
The course has eight levels, from 0 (Python from scratch) to 7 (production and final project). Each level is divided into modules and each module into lessons like this one. The figure at the top shows the approximate hours of each level: the total is around 750–850 hours.
Mermaid source
flowchart TB
L[Lesson] --> E[Exercises] --> A[Self-assessment]
A --> M{All clear?}
M -- yes --> S[Next lesson]
M -- no --> L
S -. at the end of the level .-> P[Level project]
P -. at the end of the course .-> C[Final project]Every lesson has the same parts:
- Objectives at the start: what you should be able to do when you finish.
- Content with runnable code. All the code in the course has actually been run and the outputs you see are real. The level 0 data are synthetic (generated with a seed) so that you get exactly the same result.
- Exercises with the solution collapsed. Try to solve them before opening it.
- Self-assessment: three to five questions with the answer and the reasoning behind it.
- Key ideas and resources to go deeper.
The levels are cumulative, but you do not have to go through all of them in order. The syllabus proposes four paths depending on your starting point:
Entry tests: when to skip a level
Each level has an explicit prerequisite (on the level's page). To find out whether you can skip it, use its self-assessments as an entry test: go through those of all its lessons without looking at the content. If you answer all of them correctly and understand the reasoning behind each answer, move on to the next level. If you fail the ones in a module, do only that module.
Two warnings. First: level 0 looks dispensable for someone who already programs, but it includes tools that have changed a lot in two years (uv, pandas 3.0, Polars, DuckDB); review at least module 0.5. Second: the self-assessments measure concepts, not fluency. If a question seems easy but you could not write the exercise code without help, do not skip the module.
Your course repository
Everything you write during the course lives in a single Git repository. It starts with a few folders and ends up being your personal framework: the level 1 functions (data download and cleaning) will be used by the level 2 backtest, and both will be used by the level 4 live system.
The recommended structure, created with pathlib (covered in module 0.4; here only the result matters):
import tempfile
from pathlib import Path
raiz = Path(tempfile.mkdtemp()) / "ppt-curso"
carpetas = ["datos/brutos", "datos/procesados", "notebooks", "src/ppt",
"tests", "informes"]
for carpeta in carpetas:
(raiz / carpeta).mkdir(parents=True)
(raiz / "src/ppt/__init__.py").touch()
(raiz / "README.md").write_text("# My course repository\n")
ignorar = [".venv/", ".env", "datos/brutos/", "__pycache__/"]
(raiz / ".gitignore").write_text("\n".join(ignorar) + "\n")
for ruta in sorted(raiz.rglob("*")):
nivel = len(ruta.relative_to(raiz).parts) - 1
print(" " * nivel + ruta.name + ("/" if ruta.is_dir() else "")).gitignore
README.md
datos/
brutos/
procesados/
informes/
notebooks/
src/
ppt/
__init__.py
tests/datos/brutos/(raw data): what you download, as is. It is not versioned (it can be large and sometimes its license does not allow redistribution); it can be downloaded again.datos/procesados/(processed data): clean data, in Parquet from level 1 on.notebooks/: exploration. Whatever works in a notebook is moved tosrc/.src/ppt/: your reusable code, as a Python package.tests/: tests with pytest (lesson 0.4.5).informes/(reports): the reports the projects generate.
In practice it is not created with Python, but with uv and Git from the terminal. You will do it in module 0.2; these are the commands, so that you recognize them:
uv init ppt-curso # project with pyproject.toml (lesson 0.2.2)
cd ppt-curso
git init # repository (lesson 0.2.5)
git add .
git commit -m "Initial course structure"Learning with AI: the course rules
Coding assistants (Copilot, Claude Code, Codex, Cursor) write in seconds functions that take a beginner an hour. That makes them very useful for someone who can judge the result and dangerous for someone who cannot: the code they generate is plausible, and plausible is not the same as correct. In trading, a plausible mistake (a signal shifted one day too many or too few, a forgotten cost) produces a pretty backtest and a strategy that loses money.
That is why the course has three rules:
- Level 0 without an assistant. Write and read the code of this level yourself. You can ask a chat conceptual questions, but do not ask for the code of the exercises.
- Afterwards, the AI proposes and you decide. From level 1 on, use assistants with a fixed workflow: first you write the test the code must pass, then you ask for the code, read it in full, run the tests and only then commit.
- Nothing sensitive in the prompt. No keys, no data whose license does not allow sharing it, no personal data.
Mermaid source
flowchart TB
T[You write the test] --> P[You ask for the code] --> L[You read it in full]
L --> X{Do the tests pass?}
X -- no --> P
X -- yes --> C[Commit]Lesson 0.2.6 returns to assistants in more detail, and level 6 devotes an entire module to using them as a research copilot.
Exercises
- Choose your path. Using the paths figure and each level's page, write in your repository's
README.md(or in a note, if you do not have it yet) which level you start at, which levels you will do in full and which ones only in part.
Solution
There is no single answer. A good answer cites the prerequisite of each level you skip and why you meet it. For example: "I start with all of level 0: I have never programmed. Then 1, 2 and 4, as in the beginner path; I will do 3 only with futures, which is what I trade."
- Write your repository's
.gitignore. Besides what the lesson covers, what other things should not be versioned in a trading project?
Solution
Besides .venv/, .env, datos/brutos/ and __pycache__/: the state files of a live system (positions, orders),
logs, large notebook outputs, configuration files with broker account details and the editor's system files
(.vscode/, .idea/) unless you share them on purpose. The rule: do not version what is secret, what can be
regenerated or what is very large.
- Ask an AI assistant for a Python function that computes the daily return of a price series, without giving it any more context. Before reading the answer, write three questions whose answer should be in the code.
Solution
Some: does it use the adjusted or the unadjusted close (dividends and splits, level 1)? Simple or log return (lesson 0.7.1)? What does it do with the first day, which has no previous day? Does it sort the series by date or assume it is already sorted? What happens if there are gaps or repeated prices? If the code does not answer one of them, the assistant has made the decision for you without telling you: that is the reason to read it in full.
Each answer is folded under its question
Self-assessment
You already program in Python and use pandas every day, but you do not know the markets. Where do you start?
- AWith lesson 0.1.1 and all of level 0 in order
- BWith the level 0 self-assessments; if you pass them, with level 1
- CWith level 5, the machine learning one
- DWith the final project
Show answer
Answer B. With the level 0 self-assessments; if you pass them, with level 1
The programmer or data scientist path starts with the test and enters at level 1, which is where the markets are. The level 0 self-assessments are there to check it.
What must never go into the course repository?
- AThe notebooks
- BThe tests
- CThe
README.md - DThe
.envfile with API keys
Show answer
Answer D. The
.envfile with API keysA key pushed to a repository, even a private one and even if it is deleted later, must be treated as compromised: it stays in the Git history. That is why
.envgoes in.gitignorefrom the first commit.According to the course rules, when do you start using an AI coding assistant?
- AFrom the first lesson, to go faster
- BNever
- CAfter level 0, once you can write and read code without help, and always with review and tests
- DOnly in the final project
Show answer
Answer C. After level 0, once you can write and read code without help, and always with review and tests
An assistant speeds up someone who can judge its output. Level 0 is where you learn to write and read code; from then on, the AI proposes and you review, test and version.
Key points
- The course has 8 cumulative levels; each level ends with a project and the course with a final project.
- A level's self-assessments work as an entry test: if you pass all of them, you can skip it.
- A single Git repository grows throughout the course and ends up being your personal framework.
- Keys and raw data are never committed:
.envanddatos/brutos/go in.gitignorefrom the first commit. - The AI proposes, you decide: first without an assistant; then with review, tests and version control.