Beginner Python for people who want to be ready for machine learning libraries next — not a NumPy/pandas/scikit-learn course yet.
Start here: notebooks/00_Colab_and_First_Program.ipynb · Open in Colab
Track progress: GitHub Pages dashboard (self-tracked in your browser)
- You can use a browser. You do not need Python installed locally.
- You want a stepped path: Colab → values → collections → control flow → functions → files → data preparation.
- After the capstone you should be ready to open a NumPy or pandas tutorial without fighting basic Python.
- This course teaches the Python that pandas and scikit-learn assume you already know: tidy rows, missing vs
0,strip, dates, numericX, train-only stats.
Those libraries will not teach this. Each skill below is practiced in pure Python, then named in the library you will meet next.
| You learn here | Notebook | You will type later |
|---|---|---|
strip / replace / join |
01 | s.str.strip(), s.str.replace() |
is None, not == None |
01 | isna() — and never df == np.nan |
dict in, .get, .items() |
02 | column lookup; df.items() |
sorted(xs) vs xs.sort() |
02 | df.sort_values() returns a new frame |
dict counts, any / all, missing vs 0 |
03 | value_counts(), isna().any(), df[mask] |
help / .__doc__, copy don't mutate |
04 | help(pd.read_csv), Copy-on-Write |
JSON/CSV, datetime, NaN / isclose |
05 | read_csv, to_datetime, isna() |
Split first, train-only scale, codes, X as numbers |
06 | train_test_split, MinMaxScaler, OneHotEncoder |
| Dirty CSV → checked train/valid bundle | 07 | A pandas Pipeline does the same verbs |
Skip for now: NumPy, pandas, scikit-learn, regex, class inheritance, input().
- Work in Google Colab. Click a badge, then File → Save a copy in Drive.
- Run each notebook from the top. If the runtime gets confused, Runtime → Restart session and Run all.
- Practice cells already contain working answers so the notebook can be verified. To practice, delete the answer, rewrite it, and run the check.
- Optional: fork this repository and enable the Pages dashboard so your copy has its own progress page.
There is no input() in the maintained notebooks, so they never wait for a prompt.
flowchart LR
startNode["Open notebook 00 "] --> copyDrive["Save a copy in Drive "]
copyDrive --> runTop["Run cells top to bottom "]
runTop --> rewrite["Rewrite the practice cells "]
rewrite --> nextNb["Open the next notebook "]
nextNb --> optionalDash["Optional: tick progress on Pages "]
| # | Notebook | Time | What you learn | Colab |
|---|---|---|---|---|
| 00 | Colab and your first program | 40 min | Runtime, print, variables, +=, unpacking, indentation, reading errors |
Open |
| 01 | Values, strings, and conversion | 55 min | Types, / // %, strip/replace/join, is None, converting CSV-like strings, f-strings |
Open |
| 02 | Collections, indexing, and slicing | 60 min | Lists, tuples, dicts, sets, in on keys, .get/.items(), sorted vs .sort(), copies |
Open |
| 03 | Conditionals and loops | 60 min | if/elif, loops, dict counts, any/all, missing vs 0 |
Open |
| 04 | Functions, scope, and comprehensions | 55 min | def, returns, docstrings/help, copy-not-mutate, list/dict comprehensions |
Open |
| 05 | Errors, modules, and files | 60 min | Errors, pathlib, JSON, CSV, datetime, NaN / isclose |
Open |
| 06 | Python data workflows for ML | 65 min | Clean rows, codes and one-hot, table shapes, split first, train-only scaling | Open |
| 07 | Fundamentals capstone | 60 min | Prepare a dirty bike-share CSV end to end — no model yet | Open |
About seven to eight hours if you do the practices instead of only reading.
flowchart TB
subgraph pythonBasics ["Python basics "]
n00["00 Colab "]
n01["01 Values "]
n02["02 Collections "]
n03["03 Conditionals "]
n04["04 Functions "]
n05["05 Files "]
end
subgraph mlReady ["Ready for ML libraries "]
n06["06 Data workflows "]
n07["07 Capstone "]
end
n00 --> n01 --> n02 --> n03 --> n04 --> n05 --> n06 --> n07
Each notebook repeats a short cycle: explain → predict → run → practice → check.
Concept sections in each notebook include Mermaid diagrams of the idea (runtime, types, aliases, splits, and so on). They show as pictures in Colab and as Mermaid on GitHub.
flowchart LR
explain["Explain "] --> predict["Predict "]
predict --> runCell["Run "]
runCell --> practice["Practice "]
practice --> check["Check "]
- Predict questions ask you to decide the output before you run. Answers sit under After you run.
- Practice cells include a working answer so Run all never fails. Comment it out, rewrite it, then run the check.
- Checks are
assertstatements that printPractice xx.y passed. - Hints sit under each practice. Solutions and a short Check your understanding section are at the end.
Notebook 07 prepares a dirty bike-share CSV in pure Python: parse, type, drop missing/invalid/duplicate rows, derive features, split 80/20 by id, min-max scale using training rows only, then export a JSON bundle. You do not train a model.
You are done when every capstone check prints passed.
flowchart TB
rawCsv["Dirty bike-share CSV "] --> parseRows["Parse to dictionaries "]
parseRows --> dropBad["Drop missing, invalid, and duplicate rows "]
dropBad --> derive["Derive km_per_hour and age_group "]
derive --> splitData["Sort by id and split 80/20 "]
splitData --> trainRows["Train rows "]
splitData --> validRows["Validation rows "]
trainRows --> fitScale["Fit min-max on train only "]
fitScale --> scaleTrain["Scale train "]
fitScale --> scaleValid["Scale validation "]
scaleTrain --> bundle["Export JSON bundle "]
scaleValid --> bundle
Progress is self-tracked in localStorage. GitHub Actions does not grade your Colab work. The quality workflow only checks that the maintained notebooks still run.
On your fork:
- Enable Actions if GitHub asks (the first Actions tab visit).
- Open Settings → Pages.
- Set Source to GitHub Actions. This has to exist before the deploy workflow can publish; the first run fails with
Get Pages site faileduntil it is on. - Run Deploy course dashboard from the Actions tab, or push a change under
site/. - Open
https://<your-username>.github.io/python-crash-course/.
The dashboard writes Colab links for your owner/repo/branch. Export JSON if you switch browsers. Reset stays on that device.
flowchart TB
forkRepo["Fork the repository "] --> enableActions["Enable Actions "]
enableActions --> enablePages["Settings: Pages source is GitHub Actions "]
enablePages --> deployDash["Run Deploy course dashboard "]
deployDash --> yourSite["github.io dashboard for your fork "]
yourSite --> yourColab["Colab links open notebooks on your fork "]
After this course:
- NumPy arrays
- pandas DataFrames (
dropna,to_datetime, boolean masks) - a plotting library (Matplotlib or Seaborn)
- scikit-learn
Pipeline,train_test_split, andrandom_state
The verbs stay the same: clean, split, scale, encode, check.
flowchart LR
readme["README "] --> notebooks["notebooks/ current course "]
readme --> site["site/ Pages dashboard "]
readme --> workflows["GitHub Actions "]
readme --> legacy["legacy/ archived classroom files "]
workflows --> quality["course-quality "]
workflows --> pagesDeploy["deploy-pages "]
Maintained materials are notebooks/ and site/. CI executes only the numbered notebooks. Historical files stay in legacy/ and are not part of the path above.
Older live-session notebooks and scripts live in legacy/. They are unmaintained and are not part of the numbered path. Several of them do not run top-to-bottom; that is expected.
Ali Mustufa — iali.dev · @ialimustufa