Objective. Students construct and interpret histograms, box plots, and frequency tables to describe the shape, center, and spread of a distribution.
This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
When you collect a set of numerical measurements — wages, trip durations, test scores — those values are rarely all the same. They spread out across a range, and that spread has a shape. A distribution describes how often each value (or range of values) occurs. Understanding the shape of a distribution tells you where most values cluster, how far values stray from the center, and whether unusual values (outliers) are present. These insights drive every downstream decision in data analysis, from choosing the right summary statistic to selecting the correct machine-learning algorithm.
The simplest way to summarize a numeric variable is a frequency table. You divide the range of the data into equal-width intervals called bins (or classes), then count how many observations fall into each bin. A relative frequency column shows each count as a proportion of the total, making tables from different datasets comparable. Frequency tables are your first sanity check: they reveal gaps, unexpected spikes, and impossible values before you ever draw a chart.
A histogram is the visual version of a frequency table. Each bin becomes a bar; bar height encodes frequency or relative frequency. Unlike a bar chart for categorical data, histogram bars touch each other because the underlying variable is continuous.
Bin width matters. Too few bins (very wide bars) flatten the shape and hide structure. Too many bins (very narrow bars) produce a jagged, noisy picture. A common starting rule is to use roughly the square root of the number of observations as your bin count, then adjust visually. In pandas and seaborn you control this with the `bins` parameter.
```python
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_csv('trips.csv')
sns.histplot(df['duration_min'], bins=30, kde=False)
plt.xlabel('Trip Duration (minutes)')
plt.ylabel('Count')
plt.title('Distribution of Ride-Share Trip Durations')
plt.show()
```
Always label axes and add a title. A chart without labels is professionally unacceptable and earns zero credit on rubrics.
A box plot (box-and-whisker plot) compresses the distribution into five summary values — the minimum, first quartile (Q1), median (Q2), third quartile (Q3), and maximum — plus individual points for outliers.
Box plots shine when you compare groups. Side-by-side box plots — one per day of the week, for example — let you spot whether Monday trips are longer than Saturday trips at a glance.
```python
sns.boxplot(data=df, x='day_of_week', y='duration_min',
order=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'])
plt.title('Trip Duration by Day of Week')
plt.show()
```
Once you see your histogram or box plot, describe the shape with standard vocabulary.
| Shape | What you see | Mean vs. Median |
|---|---|---|
| Symmetric (bell-shaped) | Mirror image left and right of center | Mean ≈ Median |
| Right-skewed (positive skew) | Long tail stretches to the right; bulk of data on the left | Mean > Median |
| Left-skewed (negative skew) | Long tail stretches to the left; bulk of data on the right | Mean < Median |
Why does skew affect the mean? The mean is pulled toward the tail because it uses every value in its calculation. The median, which is simply the middle-ranked value, resists the pull of extreme values. In right-skewed distributions such as income or trip duration, the median is usually a better representation of the "typical" value.
An outlier is a value that lies far from the bulk of the data. Outliers are not automatically errors — a genuinely long trip is real — but they deserve investigation. Ask:
1. Is this a data-entry or sensor error (a trip recorded as 9,000 minutes)?
2. Is it a legitimate rare event?
3. Does it belong to a different subpopulation?
Document your findings in a written reflection. Good analysts always note data-quality concerns rather than silently deleting rows.
Data science work is primarily office or remote-desktop work, but ergonomic and digital safety practices apply. Protect sensitive datasets (PII such as location traces in ride-share data) according to your organization's data governance policy. Never store real passenger data on a personal or unsecured device. When using shared JupyterHub servers, log out after each session and never share login credentials — credential sharing is a security violation equivalent to leaving a physical workstation unlocked.
For the lab exercise you will load the Chicago TNC trip dataset, inspect it with `df.describe()`, build a histogram with an appropriate bin count, then produce side-by-side box plots split by day of week. In your written reflection, name the shape of the overall distribution, explain what that shape implies for using the mean versus the median, and flag at least one data-quality concern you observe. Accurate axis labels, a descriptive title, and correct outlier identification are required to pass the 10-point rubric.
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.
Does the school offer financial aid?
No. We don’t offer financial aid because we’re free. No, really: completely free.
Do you offer industry certification?
No. We are not certified yet, so we can’t offer that to students. What we do offer is knowledge and understanding of a trade.
Enroll first in the trade you’re interested in. You get your key, your program opens, and you begin studying.
Enroll free →