2 How to Use This Book
How to Use This Book
2.1 The two halves: chapters and labs
The book has two halves that travel together.
Chapters (Parts 0–VII and IX) are the narrative — read them. They build a single arc from “set up your tools” through chat workflows, the terminal, agentic AI, text as data, AI in empirical research, APIs, and a full capstone. Read them in order the first time. Skim and reference them later.
Labs (Part VIII) are the practice — work through them. Each lab is a self-contained exercise: a brief, a dataset (or instructions for getting one), a prompt or two, a deliverable. Labs preserve the original course material as-is so you can do them on your own without an instructor in the room. Many labs map 1-to-1 to assignments from the live course.
A typical study unit:
- Read one or two chapters.
- Do the matching lab.
- Write your “AI and me” reflection at the end of the lab.
2.2 Chapter length and shape
Chapters vary in length. Some are one or two pages — a single idea, a single example, a single check. Some are four or five pages — a workflow that needs the room. Length follows the idea, not a fixed schedule.
Every chapter has the same skeleton: an opening hook, three to five concrete outcomes, the body, a short “Where AI helps · Where AI bluffs” callout, a “Keep this with you, not the AI” reminder, a small “Try this” exercise, and the same three reflection questions. The full specification, for the curious, is in chapter-template.qmd.
2.3 Three reader profiles
Self-learner. Start at the preface, read straight through, do every lab. Plan on roughly two evenings per chapter for the early parts and a full weekend per part once you hit the CLI material in Part III. The capstone in Part VII expects you to set aside three full sessions of a few hours each.
Student in a course. Your instructor will assign chapters and labs in some order. The book’s linear arc is one valid path; your syllabus is another. Use the chapters as preparation reading and the labs as homework.
Instructor. Fork the repo. Re-mix chapters into the rhythm of your class; the labs were originally weekly assignments and still work as such. The website version of the same material — sidebar by week — lives at gabors-data-analysis.com/ai-course/. License is CC BY-NC-SA 4.0; see the appendix for attribution.
2.4 What you need before you start
- A working Python setup — Anaconda,
uv, or your preferred manager. The book is Python-only; see the preface for why. Part 0 walks you through the install. - An account with at least one frontier chat model. This edition was written against Claude Opus 4.7 and ChatGPT 5.5; either works for almost every chapter, with occasional notes on where they differ. See Edition and Model Snapshot.
- A terminal you are willing to live in (macOS Terminal / iTerm, Windows PowerShell or WSL, any Linux shell). Part 0 walks you through it.
- A GitHub account. Free is fine. Part 0 walks you through it.
- About five US dollars of API credit on one provider for Part VI and the capstone. Optional for the rest of the book.
2.5 A note on AI in your work
The course has one unbreakable rule and the book inherits it:
Use AI freely. Do not submit something created by AI. AI is your assistant, not your ghostwriter.
In every lab you should be able to defend every line of code and every claim in your write-up. If you cannot, you have over-delegated. The point of the labs is to practice exactly this judgement. Part IX has a chapter on what this means in practice — what to disclose, how to cite, what your method section should say.
At the end of each chapter and lab, three questions:
- How did AI support me in doing what I planned?
- How did AI fail me — half-truths, buggy code, imprecise arguments?
- How did AI extend me — letting me do things I couldn’t, or giving me new ideas?
Write the answers down. They are the most important artefact you will produce.
2.6 Conventions
- Code blocks are Python, end of story. Principles transfer to R, Stata, or Julia; the code in this edition does not.
- Callouts mark places where the AI tooling is most likely to mislead you, and where human judgement matters most.
- No pictures by default. Where a diagram would explain something the prose cannot, we draw one. Otherwise we trust the prose.
- Case studies (World Values Survey, Austrian Hotels, football interviews, US earnings, employee commits) recur across chapters. The Reference part lists them with one-page summaries.
- Many short chapters. Single-idea chapters over long bundled ones — they read better and re-mix more easily for instructors.