Python Foundations for Geospatial Data Science:
From Basics to AI-Assisted Coding
Learn Python from scratch — every line runnable, no setup required.
Every serious geospatial, data science, and analytics workflow starts with Python. This course gives you the practical foundation to actually write it — not follow along, not copy-paste, but understand what you're building and why it works. It's deliberately minimal: only the parts of Python you use in roughly 80% of daily data work, taught through examples drawn from the language of cities — districts, populations, density, parks — so the shape of the problems is already familiar when you move on to real spatial datasets. Nothing to download, no accounts, no API keys: every example is small enough to type and run in seconds, which means you spend your time understanding code rather than debugging an environment. You move from your very first variable through the full core stack, then finish where modern coding actually lives: working alongside an AI assistant, prompting it well, and catching it when it's confidently wrong.
The one habit the whole course builds — inspect before you trust — is the same discipline that lets you interrogate an AI's output without being fooled by it.
WHAT YOU'LL BUILD
You don't start from a template. You start from the atoms of the language and assemble a complete working toolkit.
A solid Python foundation. Assignment → types → arithmetic → strings → f-strings → the ✓-print discipline that confirms what just happened. By chapter 2 you're not guessing at what your code did — you're reading it back.
A command of data structures. Lists, tuples, dictionaries, sets — and the intuition that a dict is a record and a list of dicts is a table, which is exactly the mental bridge to pandas two chapters later. Plus list comprehensions: the one-liner you'll reach for daily.
Control flow and reusable logic. If/elif/else decisions, for loops with enumerate and range, the accumulate pattern (loop + append — the seed of building DataFrames), and functions that package logic you want to run again.
Numerical computing with NumPy. Arrays, shape, vectorised arithmetic — operate on every element at once, no loop required — and the boolean mask: compare, then select. That single idea becomes pandas filtering one chapter later.
Tabular data with pandas. Build a DataFrame, inspect it properly, derive a new column (density = population / area — the move you'll make a thousand times), filter with boolean masks, group, merge, handle missing values, and write to CSV.
Readable figures with matplotlib. One disciplined idiom — f, ax = plt.subplots — reused across line, bar, pie, scatter, histogram, and multi-panel charts. The difference between a plot that works and a figure someone else can read.
Professional workflow craft. The config block, pathlib, accumulate-to-DataFrame, save-then-reload staging, print-feedback and len() checks, and reading an error message bottom-up. The habits that make analysis reproducible instead of lucky.
Coding with an AI assistant. What a good prompt contains (context, exact goal, constraints), the prompting loop, and hands-on exercises where a deliberately vague prompt gets troubleshot live and a well-specified one works first time — then you ask the AI to write its own ideal prompt and compare. Prompting as a skill you can articulate, not a vibe.
WHO THIS IS FOR
You've never written code, and you want to start with the language that actually matters for data work — without a 50-hour commitment.
You work in QGIS or ArcGIS and keep hearing you should learn Python. This is the crossing, built by someone who came into geospatial work through code rather than through the GUI.
You're an analyst, researcher, or domain expert who can already do the thinking, and you need Python to scale it, repeat it, and stop doing it by hand.
You're aiming at the geospatial or data-science courses above this one and want the foundations they assume — properly, rather than by osmosis.
WHAT YOU'LL LEARN
By the end of this course you can:
Explain what a Jupyter notebook is, what the kernel does, and why execution order — not position on the page — determines what your code sees.
Write clean Python with descriptive names, f-string output, and comments that say why rather than restating the code.
Choose the right data structure without hesitating: list for ordered and mutable, tuple for fixed groupings, dict for named records, set for uniqueness.
Write any repetitive operation as a for loop, build results with the accumulate pattern, and compress simple loops into a list comprehension.
Package logic into functions with clear parameters and return values, and pull in the standard library for maths, dates, seeded randomness, quick statistics, and file handling.
Create NumPy arrays, do vectorised arithmetic without loops, and use boolean masks to select exactly the values you want.
Run the full pandas workflow on a table: create, inspect, derive, filter, group, merge, fill gaps, and save.
Produce matplotlib figures through the axes-object pattern — titled, labelled, styled, and legible to someone who wasn't there when you made them.
Apply the workflow disciplines that keep analysis honest: config blocks, pathlib, staged saves, len() checks after every filter, and inspect-before-you-trust.
Write prompts that get correct code from an AI first time — and recognise the failure modes when it doesn't: invented functions, guessed column names, plausible-looking wrong answers.
COURSE STRUCTURE
Chapter 1 — Getting Started
What a Jupyter notebook actually is, installing and launching Python, running cells and reading output, your first real code with the ✓-feedback voice, Markdown and the keyboard shortcuts worth knowing.
Chapter 2 — Values, Variables, and Operations
Variables and the four everyday types, arithmetic including floor division, modulus and exponentiation, type casting and its one classic gotcha, and the string toolkit — f-strings throughout.
Chapter 3 — Data Structures
Lists (creation, indexing, slicing, methods, comprehensions), tuples and unpacking, dictionaries as records, lists-of-dicts as tables, and sets with their mathematical operations.
Chapter 4 — Control Flow
Conditionals with if/elif/else and combined conditions, for loops with enumerate and range, and the accumulate pattern.
Chapter 5 — Functions and Modules
Writing and calling functions, parameters and returns, then the standard library that earns its keep: math, datetime, random (seeded), statistics, and os for guarded file handling.
Chapter 6 — NumPy
Arrays and shape, indexing and slicing, vectorised arithmetic, aggregations, reshape and transpose, and the boolean mask.
Chapter 7 — Pandas
DataFrames from a dict, the first-look ritual, column selection, deriving columns, filtering with masks (single, multiple, isin), describe, groupby, merge, missing data, and CSV I/O.
Chapter 8 — Matplotlib
The f, ax = plt.subplots idiom as the single taught form; line, bar and pie charts; customisation with titles, labels, limits and styling; scatter, histogram, and multi-panel figures.
Chapter 9 — Workflow Craft
A consolidation chapter: the config block, pathlib and a tidy data folder, accumulate-to-DataFrame, save-then-reload staging, print feedback and len() checks as engineering discipline, reading an error message, and inspect-before-you-trust as a named principle.
Chapter 10 — Coding with Claude
What a good prompt looks like and the prompting loop, followed by hands-on exercises of increasing difficulty — each paired with a deliberately weak prompt to troubleshoot and a strong prompt that works first time.
WHAT'S INCLUDED
🎬 ~3 hours of video lectures on the New Science of Maps platform
📓 Two Jupyter notebook versions per lesson — a commented standalone notebook to learn from, and the exact notebook used in the recording
✏️ Per-chapter exercises in two versions: an empty scaffold to attempt yourself, and a fully worked solution
🚀 Zero setup beyond installing Python — every example is self-contained and runs in seconds
♾️ Lifetime access, including future updates
PREREQUISITES / WHO IT'S NOT FOR
Prerequisites: none. This is a genuine beginner course — no prior coding experience assumed. Chapter 1 starts before the code, with installing Python and launching your first notebook.
Recommended next step: the Urban Analytics with Python series picks up exactly where this leaves off — real spatial datasets, OpenStreetMap, and analysis across a whole city, all assuming the Python fluency you build here.
Not for you if: you already write Python comfortably; you want spatial modeling, machine learning, or large real-world datasets from day one (start with Urban Analytics instead); or you're looking for a no-code tool.
INSTRUCTOR
Taught by Milan Janosov — geospatial data scientist, network scientist (PhD), Forbes 30 Under 30, and practitioner. Ranked #1 globally in Data Science on LinkedIn. You build alongside a working scientist, with honest attention to what each concept is for and what it sets up next.