Mathew K Analytics

My books: learn Python, data analytics and SQL

The lessons on this site are free and will stay that way. Some people prefer to learn from a book, with everything in one order and exercises that come with answers, so I've written 18. Here's what each one covers, who it's for and where to start.

Which book should you start with?

Together they make a path: Python basics first, then analysis with pandas in Jupyter, with SQL alongside whenever your data lives in a database. That is the same order most analysts I've worked with learned in, and the order I'd learn in again.

Every book uses one fictional business from start to finish, so the examples build on each other instead of jumping between toy datasets. The practice files are free on GitHub, so you can see exactly what you'll be working with before you buy.

Cover of Python from Zero

Complete beginners

Python from Zero

A friendly, hands-on guide to writing your first real programs

Never written a line of code? Start here. You learn Python by building real tools for Sunny Paws, a small animal shelter, one small step at a time: a fee calculator, a feeding schedule, animal records and a donations report. In the last project you put it all together into a complete Shelter Manager program with menus, saved data and its own tests.

What you'll learn

  • Installing Python and JupyterLab, and running code three ways
  • Variables, text, decisions with if, and loops
  • Lists, dictionaries, functions and modules
  • Reading tracebacks calmly and fixing the errors beginners really make
  • Files, CSV and JSON, and automating everyday chores
  • Testing with pytest and planning a complete program from a blank page

📂 Free practice files on GitHub

Cover of Data Analytics with Python and Jupyter Notebook

Beginners who know a little Python

Data Analytics with Python and Jupyter Notebook

A hands-on guide from first notebook to finished analysis

The full analyst workflow in Jupyter, from loading a messy file to presenting a finished analysis. You work through NumPy, pandas, cleaning, joining, dates and time series, exploratory analysis, charts in Matplotlib, seaborn and Plotly, the statistics analysts actually use and a first predictive model. It finishes with a capstone annual review for Bean There, a fictional coffee business.

What you'll learn

  • Working comfortably in Jupyter Notebook
  • pandas from the basics to grouping, reshaping and merging
  • Cleaning data and working with dates and time series
  • Exploratory analysis and clear charts with Matplotlib, seaborn and Plotly
  • Statistics for analysts and a first look at predictive modelling
  • Communicating results so people act on them

📂 Free practice files on GitHub

Cover of SQL for Analysts Who Hate SQL

Excel users moving to SQL

SQL for Analysts Who Hate SQL

50 real business questions, one query each, explained in plain English

If you are good in Excel but stuck waiting for someone else to pull the data, this book is for you. It teaches SQL through 50 questions managers really ask, each answered with one query and explained line by line next to the Excel move you already know. Every example runs on a free practice database for Bean & Leaf Co., an online coffee and tea shop with deliberately messy data.

What you'll learn

  • Swapping pivot tables for GROUP BY and VLOOKUPs for joins
  • Cleaning messy data, handling blanks and working with dates
  • Ranking, comparing periods and running totals with window functions
  • Churn, cohort retention, lifetime value and marketing return
  • Checking your numbers before anyone else does
  • Notes for PostgreSQL, SQL Server, MySQL and BigQuery

📂 Free practice files on GitHub

Cover of The Excel-to-Python Bridge

Excel users starting Python

The Excel-to-Python Bridge

Every spreadsheet task you already know, translated into pandas side by side

You already analyse data in Excel. This book shows you how to do the same work in Python, one familiar task at a time. VLOOKUP becomes a merge, SUMIFS becomes a groupby, a pivot table becomes pivot_table, and a two-hour monthly report becomes one command. Every example runs on one realistic company workbook, with the real output printed and plain-English notes.

What you'll learn

  • Loading workbooks and CSV files and exploring them the way you would in Excel
  • Replacing VLOOKUP, XLOOKUP and INDEX/MATCH with merges that never break
  • Turning SUMIFS, COUNTIFS and pivot tables into one-line summaries
  • Cleaning messy exports: spaces, dates, duplicates, numbers stored as text
  • Combining dozens of files and reshaping wide sheets
  • Writing formatted Excel reports and automating a monthly report

📂 Free practice files on GitHub

Cover of Dashboards That Get Read

Analysts and BI developers

Dashboards That Get Read

Design principles and before-and-after makeovers for executive dashboards

Most dashboards are built carefully and then ignored. Follow an analyst at a fictional Australian retailer as she replaces a cluttered twelve-tile executive dashboard with a single page that now opens every leadership meeting. Every principle is shown on real charts, before and after, with Power BI and Tableau steps and seven full makeovers.

What you'll learn

  • Scoping a dashboard around a decision with a one-page brief
  • Choosing three to six KPIs that balance each other
  • Laying out a page that passes the five-second test
  • Picking the right chart, and retiring gauges, pies and dual axes
  • Using colour with a purpose: grey, one accent, red only for problems
  • Building it in Power BI or Tableau and keeping it in use

📂 Free practice files on GitHub

Cover of A/B Testing Without a Statistics Degree

Analysts, product managers and marketers

A/B Testing Without a Statistics Degree

Sample sizes, significance and the traps that fool smart teams

Your testing tool says the new version is winning by 18%. Should you ship it? This guide shows you how to plan a test, read the result and avoid the traps that fool smart teams, with every idea worked through on a fictional retailer's data in plain numbers, Excel and Python.

What you'll learn

  • Working out sample size and test length before you start
  • Reading p-values and confidence intervals without the myths
  • Handling revenue, outliers and skewed metrics
  • Catching peeking, sample ratio mismatch and segment fishing
  • Making tests faster with CUPED
  • Writing one-page results leaders act on

📂 Free practice files on GitHub

Cover of Cleaning Messy Data

Analysts and anyone who receives data from someone else

Cleaning Messy Data

A field guide to 30 real-world data problems and how to fix each one in Python, SQL and Excel

The file looked fine. It wasn't. This field guide names the 30 data problems you will actually meet, from garbled characters and lost leading zeros to ambiguous dates and duplicate customers, and shows how to find every instance, fix it in Python, SQL or Excel, and prove the fix worked. Every example follows one realistic project merging a newly acquired retailer's files.

What you'll learn

  • Profiling a new file in minutes and listing what is wrong before fixing anything
  • Reading files with the wrong encoding, delimiter, header row or number format
  • Standardising messy text, categories, names, phone numbers and emails
  • Parsing mixed date formats, Excel serial numbers and time zones
  • Finding duplicates and catching joins that add or drop rows
  • Turning your fixes into a repeatable script with checks and a cleaning log

📂 Free practice files on GitHub

Cover of Breaking Into Data Analytics After 30

Career changers

Breaking Into Data Analytics After 30

A career-change roadmap with the skills that matter, three portfolio projects and a 90-day plan to your first analyst job

Nurses, teachers, hospitality managers and accountants already make decisions with data. This book is the route from that experience to a job title with "analyst" in it: what analysts actually do all week, the skills employers test, three complete portfolio projects on free practice data, and a 13-week plan you can follow alongside a full-time job.

What you'll learn

  • The 2026 job market, with Australian, US and UK salary figures
  • The SQL, Excel, Python and Power BI skills employers actually test
  • Three complete portfolio projects, from first query to one-page write-up
  • Rewriting your CV and LinkedIn, and making the internal move
  • SQL drills, a practice take-home task and an interview question bank
  • A 90-day plan with a tracker and templates

📂 Free practice files on GitHub

Cover of The Data Science Interview Playbook

Job seekers

The Data Science Interview Playbook

SQL, statistics, case questions and take-home tasks, with worked model answers

Data science and analyst interviews test the same skills again and again. This book doesn't just list questions: it works through more than 70 of them with what the interviewer is really testing, a model answer and the words to say out loud. Every query and line of code runs against Corella Market, a fictional grocery delivery business, so the output on the page is exactly what you'll see.

What you'll learn

  • SQL from joins and NULL traps to window functions, cohorts, funnels and gaps-and-islands
  • Python and pandas live-coding patterns, and the bugs interviewers want you to catch
  • Probability, p-values, confidence intervals and the bootstrap, explained plainly
  • A/B test design and analysis, including sample size, peeking and segment traps
  • Product, metrics and estimation cases with a structure you can reuse
  • A complete take-home task from brief to one-page summary, plus behavioural stories

📂 Free practice files on GitHub

Cover of From Analyst to Senior Analyst

Working analysts

From Analyst to Senior Analyst

Stakeholders, scoping, saying no and the other skills that get analysts promoted

Analysts are hired for SQL, Python and dashboards, and promoted for judgement, stakeholder skills and ownership. Nobody teaches those. This book follows Priya, an analyst at a fictional health insurer, through the year she goes from strong performer to senior analyst, with scripts, templates and twelve tricky workplace situations worked through with what to say.

What you'll learn

  • Finding the decision behind a request before you start work
  • Scoping work on one page and stopping scope creep
  • Giving estimates you can keep, using your own track record
  • Saying no, not yet, or yes-if, with ready-made scripts
  • Leading with the answer and handling pushback and bad news calmly
  • Building a promotion case from evidence, not hope

📂 Free practice files on GitHub

Cover of Freelancing as a Data Analyst

Analysts going freelance

Freelancing as a Data Analyst

How to find clients, price projects and write proposals that win work

Most analysts who go freelance underprice their first projects, chase clients on crowded platforms and give away hours to scope creep. This book follows Amara, a data analyst in Adelaide, through her first 17 months on her own: the jobs she won and lost, the projects she underpriced, and the changes that lifted her fixed-price earnings per hour by more than a third.

What you'll learn

  • Working out the lowest rate you can afford from your own costs
  • Choosing what to sell so the right clients recognise themselves
  • Finding work through your network, partners, recruiters and platforms
  • Scoping projects and estimating them from your own track record
  • Writing proposals that read like the client's own problem
  • Getting paid on time, handling scope creep and growing into retainers

📂 Free practice files on GitHub

Cover of Data Storytelling for Busy People

Anyone who reports numbers

Data Storytelling for Busy People

Turn any analysis into a one-page recommendation leaders read and act on

You did the analysis, it went into a 23-slide deck, and nothing happened. This book shows you how to turn any analysis into one page a busy leader can read in two minutes and act on. It follows one realistic analysis from the first vague request to an approved decision, with the Python, SQL and Excel behind every number.

What you'll learn

  • Finding the decision behind any request before you start
  • Writing your answer as one sentence leaders can repeat
  • Building a one-page recommendation with reasons, value, risks and a clear ask
  • Choosing three numbers out of forty and charts that make one point
  • Describing uncertainty with ranges, sensitivity tables and plain words
  • Delivering bad news and null results without spin

📂 Free practice files on GitHub

Cover of Lies, Charts and Statistics

Anyone who reads charts or the news

Lies, Charts and Statistics

A field guide to misleading graphs, slippery numbers and how to see through them

Most misleading charts and statistics don't use false numbers. They use true numbers, chosen, drawn and compared in ways that point you to the wrong conclusion. This field guide shows how each trick works, with a clear picture, a worked example and the question that exposes it, so checking any claim takes about two minutes.

What you'll learn

  • Spotting truncated axes, stretched scales, flipped axes and cherry-picked dates
  • Seeing through bubbles, 3D pies, pictograms, maps and dual-axis charts
  • Telling per cent from percentage points, and relative risk from absolute risk
  • Catching missing denominators, averages that hide and comparisons that ignore inflation
  • Recognising confounders, Simpson's paradox, survivorship bias and regression to the mean
  • Running a ten-question check on any chart, poll, study or forecast

📂 Free practice files on GitHub

Cover of The Analyst's Template Pack

Working analysts and team leads

The Analyst's Template Pack

Project briefs, data dictionaries, QA checklists and handover docs, with a worked example for every one

Most analysis doesn't fail because the maths is wrong. It fails at the edges: a vague question, a column nobody understood, a skipped check, a decision that lived in one person's head. This book gives you eleven short, tested templates that fix those edges, each explained field by field and shown completed for one realistic project.

What you'll learn

  • Turning a vague request into a one-page project brief with fifteen kickoff questions
  • Writing data dictionaries that say what each column really means
  • Using metric definition cards to end "which number is right?" arguments
  • Running a 29-point QA checklist, with input checks automated in SQL and Python
  • Keeping decisions logs and writing one-page findings summaries leaders read
  • Writing handover documents that let someone else rerun your work

📂 Free practice files on GitHub

Cover of 100 Portfolio Project Ideas With Datasets

Career changers and early-career analysts

100 Portfolio Project Ideas With Datasets

Real public data, a sharp question and a step-by-step approach for every project

Hiring managers skim dozens of data portfolios in an afternoon, and most look the same: the same teaching datasets, the same notebooks, no conclusion. This book gives you 100 projects built on real public data, each with a dataset and link, a question someone could act on, a four-step approach and the trap that would undermine your result.

What you'll learn

  • Choosing three or four projects that fit the job you want
  • Finding verified public datasets across ten themes, from health and transport to sport and finance
  • Asking a specific question with an answer someone could act on
  • Working with large and messy public data without getting stuck
  • Following one project from raw file to finding in Python and SQL
  • Writing a README a reviewer can read in two minutes

📂 Free practice files on GitHub

Cover of A 30-Day Python for Data Analysis Workbook

Excel users starting Python

A 30-Day Python for Data Analysis Workbook

One pandas exercise a day, with full worked solutions

Learn pandas the way working analysts do: one practical exercise a day, for thirty days. Each day gives you one idea, one realistic exercise on a fictional Adelaide coffee roaster's data and a full worked solution, with every output shown exactly as Python prints it. By Day 30 you will have written a script that turns a raw export into a finished monthly report.

What you'll learn

  • Loading, filtering, sorting and summarising data with confidence
  • Grouping, pivoting, merging and stacking tables, and cleaning messy text
  • Working with dates, resampling, rolling averages, growth rates and cohorts
  • Finding outliers and duplicates, validating data and writing reusable functions
  • Producing charts, formatted Excel workbooks and SQL queries from Python
  • Building a simple seasonal forecast and an automated monthly report

📂 Free practice files on GitHub

Cover of AI for Analysts

Working analysts using AI tools

AI for Analysts

Using large language models to write SQL, clean data and draft reports, and how to catch them when they're wrong

Large language models can write your SQL, clean your data and draft your report in seconds. They can also join the wrong tables, misread Australian dates and invent a statistic, all in confident prose. Every chapter takes a real analyst task, shows how to prompt for it, then shows exactly how the output goes wrong on realistic data, with the wrong result printed next to the right one.

What you'll learn

  • How to build prompts with your schema, business rules and definitions so the model stops guessing
  • The nine SQL mistakes models make most, and the quick check that catches each one
  • How to get cleaning code that doesn't silently lose data, plus the tests that prove it
  • How to categorise free-text comments with a model and measure agreement with a human
  • How to check the numbers, directions and causes in a drafted report before it goes to leadership
  • A complete worked example, from a CFO's question to a checked one-page answer

📂 Free practice files on GitHub

Cover of Forecasting for Non-Forecasters

Analysts, planners and finance teams

Forecasting for Non-Forecasters

Practical sales and demand forecasting in Excel and Python, from first baseline to a forecast people trust

Somebody has to say how much will sell next month. Follow Riverbend Provisions, a fictional café supplier with five years of realistic sales data, through a full forecasting year. Every method is scored against simple baselines on data it hasn't seen, every example is shown in both Excel and Python, and every printed result is real.

What you'll learn

  • Cleaning sales history: duplicates, missing days, stockouts, holidays and trading days
  • Building baselines and measuring error properly with WAPE, bias, MASE and rolling backtests
  • Using exponential smoothing, regression with drivers and ARIMA, and knowing when each earns its place
  • Producing P10, P50 and P90 ranges and explaining them to people who want one number
  • Turning a weekly forecast into an order quantity with evidence-based safety stock
  • Running a monthly forecast process with forecast value added and tracking signals

📂 Free practice files on GitHub

How the books fit with the free lessons

Many of the topics in the books also have free video lessons and notebooks here. The books put them in a careful order, explain every line of code and add exercises with full solutions. The lessons show real projects being built on video. They work well together: read a chapter, then watch a lesson on the same topic and run its notebook. The learning paths are a good place to find those lessons.

Questions?

Leave a comment under any video on YouTube and I'll reply. Links to my own books on this page are ordinary links, not affiliate links.