7 routes42 sections324 units

Unit 1.4 · about 3 h

4 / 324

Visualize a dataset and write a data audit

A table of summary statistics rarely reveals every structural problem. A small number of targeted plots makes distributions, temporal structure and anomalous patterns visible before modeling.

  • measure
  • explain

You can now

  • Choose a histogram, line plot, bar chart or scatter plot that matches the question.
  • Label axes and units and distinguish distributions from time trends.
  • Use plots to identify outliers, seasonality and unexpected data patterns.
  • Write a compact audit that separates observations from hypotheses.

Covers

  • Exploratory plots and data audits

Study, in this order

2 steps

  1. Matplotlib Quick Start Guide
    Matplotlib Quick Start Guide

    Use the Figure/Axes workflow for labeled plots, legends, histograms and scatter plots.

  2. Bike Sharing Dataset
    Bike Sharing Dataset

    Use the hourly hour.csv table and variable descriptions; record the dataset citation and CC BY 4.0 attribution.

Focus on

  • Plot selection based on variable type and question
  • Axes, labels, units and legends
  • Demand by hour, weekday and season
  • Observation versus interpretation in the audit

Reproduce closed-book

Produce three labeled plots for bike demand: distribution of hourly counts, average demand by hour, and average demand by working day or weather condition. Explain one pattern and one limitation for each.

Traps

  • Do not infer causation from a descriptive plot.
  • Do not compare quantities with incompatible units or silently change axis scales.
  • Do not treat an aggregated trend as if every individual observation behaved that way.

Practice

Matplotlib tutorials

Recreate a histogram, a time-oriented line plot and a scatter plot with axis labels and a legend where needed.

Use plots to answer a question; don't spend time styling them.

Self-test

  1. Why is a histogram more suitable than a line plot for a single numeric variable's distribution?

  2. What should an audit say when a plot suggests demand rises during commute hours?

Completion criterion

Stop when

You can create three correctly labeled diagnostic plots and write a short data audit that distinguishes observed patterns from causal claims.

Mark passed, then open 2.1 Only mark this when you can do it without notes.

Leads to

Comes after

Resources for this unit

  • Matplotlib Quick Start Guide
    Matplotlibsupportdocumentation
    Use the Figure/Axes workflow to make labeled line plots, histograms and scatter plots. Keep plots diagnostic rather than decorative.
  • Bike Sharing Dataset
    UCI Machine Learning Repositoryrequireddataset
    Use the hourly hour.csv data for the two linked starter projects. Cite Fanaee-T (2013), DOI 10.24432/C5W894, and the CC BY 4.0 licence. cnt is the target; casual and registered are components of that target and must never be used as input features.

Also in this section

  • Kaggle Learn — Python
    Kaggle Learnprimarycourse
    Complete the course lessons on variables, functions, conditionals, lists, loops, strings, dictionaries and external libraries. Treat it as the practical Python vocabulary needed for the next units.
  • The Python Tutorial
    Python Software Foundationreferencereference
    Use as a reference for control flow, data structures, modules, files and exceptions. It assumes some prior programming experience; use Kaggle Learn for the first pass if the syntax is new.
  • Google Colab FAQ — free resources and limits
    Google Researchsupportnotebook-environment
    Use a hosted notebook for the first exercises if local setup is a distraction. The free tier has variable, non-guaranteed compute and GPU access; keep every exercise small enough to run on CPU.
  • NumPy Quickstart Tutorial
    NumPyprimarydocumentation
    Study array creation, shape, indexing, universal functions, broadcasting and basic operations. Write down shapes and dtypes before changing an array.
  • Kaggle Learn — Pandas
    Kaggle Learnprimarycourse
    Complete the short exercises on reading data, selecting, summary functions, grouping, sorting, data types, missing values and combining tables.
  • pandas Getting Started Tutorials
    pandas Development Teamrequireddocumentation
    Use the official tutorials as a reference for reading and writing tables, selecting rows and columns, creating columns, summary statistics, joins and time-series handling.

Quick find

Search Michi

Type to search every route, section, unit, topic and resource.

Enter opens the first result Esc closes

Reference

Keyboard shortcuts

n
Continue to the first unit not passed
j / k
Next / previous unit
1 2 3
Toggle learned, practised, passed
/
Open search
?
Show this help
Esc
Close open panels