← All courses
IVYXSTUDIO · COURSE

DATAVIZ 101

dataviz-101 · v1.0.0

ivyx

Charts that answer questions: build a figure whose every part you can read back, pick the artist your x axis has earned, and catch the picture that is drawn from correct numbers and still tells a reader the wrong thing.

intermediate310 min8 lessonsen
#matplotlib#seaborn#visualization#data-science#ai-series#intermediate

What this course is for

By the end of this course you can pick the plot that answers a question, build it with matplotlib or seaborn, and measure what a misleading chart is actually doing before you send it on.

What you will be able to do

  • Build a labelled figure and read every part of it back off the axes
  • Choose between a line, a cloud and bars by what the horizontal axis means
  • Defend a bin count with a check rather than with taste, and say what fell outside the range
  • Read a box plot in the vocabulary of medians, quartiles and whiskers, and spot a box that is reporting a mixture
  • Put the third column on a scatter so a reader can see what is moving the other two
  • Replace a grouping loop with one seaborn call, and name the decisions that call makes for you
  • Measure how much a chart exaggerates, and undo it without changing a number

Who it is for

Learners who finished PANDAS 101 and can clean and group a table, and anyone whose charts are copied from search results and look convincing whether or not they are

Before you start

  • PANDAS 101, or comfort with reading a CSV, filtering rows and grouping
  • NUMPY 101 level array thinking

Lesson path

The figure2 lessons

The two nouns every chart is made of, and the first real choice

  1. 1Anatomy of a figure35 min

    Build a labelled figure and name its parts, figure, axes, title, labels

  2. 2Lines and scatters35 min

    Choose between them by what the horizontal axis means

Distributions2 lessons

One column at a time, and the decisions hiding inside the friendliest charts

  1. 3Histograms and bins40 min

    Predict how 5 buckets against 50 change the story the same data tells

  2. 4Box plots and spread35 min

    Read a box plot with the variance vocabulary from AI MATH 102

Relationships2 lessons

Two columns, the number people quote about them, and the third one moving both

  1. 5Scatter and trend40 min

    Plot a relationship and say which rows the number is a fact about

  2. 6Seaborn in one move35 min

    Rebuild a hand written grouping as one seaborn call with hue

Judgment2 lessons

Correct numbers, misleading pictures, and the checklist that catches them

  1. 7Charts that lie45 min

    Take honest numbers and mislead with a truncated axis, then undo it

  2. 8Pick and defend45 min

    Three questions, three plot choices, each defended in writing

About this course

DATAVIZ 101: Charts that answer questions

Eight lessons on the last step of the pipeline, where the numbers you cleaned and grouped in PANDAS 101 become something a person takes in at a glance. Every chart in this course is drawn from correct data. Several of them mislead anyway, and taking them apart is the course.

How this course teaches

Same tutor as the rest of the series: predict before you run, and hints that climb a ladder ending in an explanation rather than pasted code. What is different here is that a chart cannot fail on its own. Plotting code succeeds whether or not the picture is honest, so every graded cell reads its own figure back and checks it:

assert ax.get_ylim()[0] == 0, "a bar is read by its length"
assert ax.collections[0].get_array() is not None, "the third column is missing"
assert np.diff(ax.lines[0].get_xydata()[:, 0]).max() <= 1, "that segment crosses a gap"

An axes is an object with a readable state, which is what turns "does this chart lie" from an opinion into a check. It is also the most useful habit the course can leave you with, because the same three lines work on a figure somebody else wrote.

What you will be able to do

  • Build a figure whose parts you can name and read back: figure, axes, title, labels, limits, legend
  • Choose between a line, a cloud of points and bars by what the horizontal axis means, and catch a line that crosses a gap in the same ink it uses for data
  • Pick a bin count you can defend with a split half check, and say what fell outside the range
  • Read a box plot as five numbers, and spot a box whose height is a mixture of two populations rather than a spread
  • Put a third column on a scatter, and show a confound instead of arguing about one
  • Replace a grouping loop with one seaborn call, and name what that call decided for you
  • Measure how much a chart exaggerates, as a number, and undo it without changing any data

The lessons

The figure

  1. Anatomy of a figure
  2. Lines and scatters

Distributions 3. Histograms and bins 4. Box plots and spread

Relationships 5. Scatter and trend 6. Seaborn in one move

Judgment 7. Charts that lie 8. Pick and defend

The lot

360 used car listings, written to disk by each lesson's setup cell from a fixed seed, so any lesson opens on its own and rerunning is always safe. It is the PANDAS 101 forecourt a season on, including the 1971 Kessel Adler that dragged the mean around there and is still unsold.

Every property of it feeds a lesson. Prices are two populations eleven thousand lira apart, which is a valley in lesson 3 and a false spread in lesson 4. Three classics ask 139,500 and up, which is what hands the whole axis to an empty region in lesson 3 and puts three dots past the whisker in lesson 4. Kilometres accumulate with the model year, so lesson 5 gets a correlation that is minus 0.11 across the lot, minus 0.84 inside one body and minus 0.03 inside one model year. Two brands ask within 2.2 percent of each other, which lesson 7 turns into a chart where one bar looks two and a half times the other.

Lesson 8 removes the file.

Where this course sits

Fifth course of the ivyx AI series and the second half of the data wave, after PANDAS 101, which is a real prerequisite: every chart here is drawn from a groupby, a filter or a merge you can already write. The judgment it installs carries forward more than the syntax does. ML 101 opens with a baseline and a scatter of predictions against truth, and every model from there on reports itself as a loss curve, which is a line over an ordered axis whose slope is the whole story. PYTORCH 102 spends a whole lesson reading those curves. You will arrive knowing what to check before believing one.

Requirements

Python 3, with pandas, numpy, matplotlib and seaborn. Verified against matplotlib 3.11 and seaborn 0.13. Two keywords in the course need recent versions: tick_labels on ax.boxplot needs matplotlib 3.9 or newer, and errorbar on sns.barplot needs seaborn 0.12 or newer.