Unit 1.4 · about 3 h
4 / 324Visualize 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
- Matplotlib Quick Start GuideMatplotlib Quick Start Guide
Use the Figure/Axes workflow for labeled plots, legends, histograms and scatter plots.
- Bike Sharing DatasetBike Sharing Dataset
Use the hourly
hour.csvtable 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
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
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
-
Why is a histogram more suitable than a line plot for a single numeric variable's distribution?
A histogram groups observations into value intervals and shows frequency; a line plot implies an ordered x-axis and connected sequence. -
What should an audit say when a plot suggests demand rises during commute hours?
It should report the observed pattern and plausible explanations separately; the plot alone does not establish why the pattern occurs.
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
- 2.1 Frame a prediction task and choose a baseline Follow the practical starter sequence; each unit uses the artifact from the previous step.
Comes after
- 1.3 Inspect and transform tabular data with pandasFollow the practical starter sequence; each unit uses the artifact from the previous step.
Resources for this unit
- Matplotlib Quick Start Guide Use the Figure/Axes workflow to make labeled line plots, histograms and scatter plots. Keep plots diagnostic rather than decorative.
- Bike Sharing Dataset Use the hourly
hour.csvdata for the two linked starter projects. Cite Fanaee-T (2013), DOI 10.24432/C5W894, and the CC BY 4.0 licence.cntis the target;casualandregisteredare components of that target and must never be used as input features.
Also in this section
- Kaggle Learn — Python 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 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 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 Study array creation, shape, indexing, universal functions, broadcasting and basic operations. Write down shapes and dtypes before changing an array.
- Kaggle Learn — Pandas Complete the short exercises on reading data, selecting, summary functions, grouping, sorting, data types, missing values and combining tables.
- pandas Getting Started Tutorials 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.