Source: https://mokxi.com/learn/path/data-analysis-plain-python
Updated: 2026-11-20

All paths

# Data analysis with plain Python

Do by hand what pandas does, on an ocean buoy's log: load and clean a CSV, describe it with statistics, group with Counter, chart in text, correlate, and turn a year of sea, waves, wind and rain into a report with a live rain gauge.

Raspberry Pi 4 Model B Free 7 lessons 6 h 4 chapters 2,298 XP Coding · Intermediate +150 XP

0 of 7 done

Start the course free Loading data Lesson plan for teachers

What you will build

## 3 projects, built step by step

7 lessons in 4 chapters, about 6 hours on a simulated Raspberry Pi 4 Model B. Free, in your browser, every step checked by the simulator.

Chapter 1 project

### Cleaning

Fix what real data gets wrong: stray spaces and lowercase, blanks turned into None, range checks that catch sentinels, a repeated day thrown out, a clean file written, and the cleaner moved into its own module.
Open it in the simulator

Chapter 2 project

### Grouping with Counter

Count and group like a database does: collections.Counter and most_common, shares that print as percentages, binning waves into sea states, a mean per wind direction with setdefault, and a count per week.
Open it in the simulator

Chapter 3 project

### Correlation

Do two columns move together? A text scatter plot, covariance, Pearson r built from its definition (this engine has no statistics.correlation), a negative correlation that is real oceanography, a one-day lag, and what one outlier does to r.
Open it in the simulator

The map

## Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

## Get the data in

Read a CSV the right way, then clean what the buoy got wrong.

Open 236 XP

### Loading data

Read a buoy log from a CSV tab: lines, then rows with the csv module, numbers with int() and float(), a crash and how to survive it, rows by column name with DictReader, and the first sign that the data is lying.

0 of 6 steps

Start What is in it

Project Locked 472 XP

### Cleaning

Fix what real data gets wrong: stray spaces and lowercase, blanks turned into None, range checks that catch sentinels, a repeated day thrown out, a clean file written, and the cleaner moved into its own module.

0 of 6 steps

5 questions, graded as you go.

Chapter 2

## Describe it

A month of ocean in a few honest numbers, counted and grouped.

Locked 236 XP

### statistics

Describe a month of ocean in a few numbers with the statistics module: mean against median and why a storm splits them, standard deviation and the n-1 question, z-scores that find the unusual day, and a summary table.

0 of 6 steps

Project Locked 410 XP

### Grouping with Counter

Count and group like a database does: collections.Counter and most_common, shares that print as percentages, binning waves into sea states, a mean per wind direction with setdefault, and a count per week.

0 of 5 steps

5 questions, graded as you go.

Chapter 3

## See it and relate it

Charts made of characters, and the math of two columns moving together.

Locked 205 XP

### Text charts

Draw data with nothing but print: a bar chart, bars scaled to a width, a histogram of wave heights, a time series turned on its side, and sparklines that fit a month on one line.

0 of 5 steps

Project Locked 472 XP

### Correlation

Do two columns move together? A text scatter plot, covariance, Pearson r built from its definition (this engine has no statistics.correlation), a negative correlation that is real oceanography, a one-day lag, and what one outlier does to r.

0 of 6 steps

5 questions, graded as you go.

Chapter 4

## Project

A year of ocean weather, from raw file to a report and a storm lamp.

Locked 267 XP

### Project: a year of ocean weather

The whole course on a year of Buoy K7: load and clean 52 weeks, compare the seasons, chart the sea temperature, correlate wind, waves, sea and rain, find the records, and add a live rain gauge with a storm lamp on the Pi.

0 of 7 steps

5 questions, graded as you go.

Syllabus

## Every lesson in the course

All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

### Get the data in

- Loading data Read a buoy log from a CSV tab: lines, then rows with the csv module, numbers with int() and float(), a crash and how to survive it, rows by column name with DictReader, and the first sign that the data is lying.
- Cleaning Fix what real data gets wrong: stray spaces and lowercase, blanks turned into None, range checks that catch sentinels, a repeated day thrown out, a clean file written, and the cleaner moved into its own module.

Chapter 2

### Describe it

- statistics Describe a month of ocean in a few numbers with the statistics module: mean against median and why a storm splits them, standard deviation and the n-1 question, z-scores that find the unusual day, and a summary table.
- Grouping with Counter Count and group like a database does: collections.Counter and most_common, shares that print as percentages, binning waves into sea states, a mean per wind direction with setdefault, and a count per week.

Chapter 3

### See it and relate it

- Text charts Draw data with nothing but print: a bar chart, bars scaled to a width, a histogram of wave heights, a time series turned on its side, and sparklines that fit a month on one line.
- Correlation Do two columns move together? A text scatter plot, covariance, Pearson r built from its definition (this engine has no statistics.correlation), a negative correlation that is real oceanography, a one-day lag, and what one outlier does to r.

Chapter 4

### Project

- Project: a year of ocean weather The whole course on a year of Buoy K7: load and clean 52 weeks, compare the seasons, chart the sea temperature, correlate wind, waves, sea and rain, find the records, and add a live rain gauge with a storm lamp on the Pi.

Kits

## Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

Have a kit already?

### Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kit

Questions

## About Data analysis with plain Python

Is Data analysis with plain Python free?

Yes. All 7 lessons of Data analysis with plain Python are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real Raspberry Pi 4 Model B?

No. Every lesson runs on a simulated Raspberry Pi 4 Model B with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Data analysis with plain Python take?

About 6 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: Cleaning, Grouping with Counter and Correlation.

Where do I start?

With "Loading data", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.
