The request

From Ashley Rivera, Web Content Lead
Your goal
Read the histogram of pages viewed per session and pick the statement that is true.
40,000 sessions, 2023 to 2025. Each bar is one page count, starting at 1. 21 sessions with more than 30 pages (up to 58) are not drawn.
Show the numbers
| Pages viewed in the session | Sessions |
|---|---|
| 1 to 2 | 17,405 |
| 2 to 3 | 4,932 |
| 3 to 4 | 3,635 |
| 4 to 5 | 3,003 |
| 5 to 6 | 2,368 |
| 6 to 7 | 1,818 |
| 7 to 8 | 1,424 |
| 8 to 9 | 1,146 |
| 9 to 10 | 885 |
| 10 to 11 | 703 |
| 11 to 12 | 607 |
| 12 to 13 | 432 |
| 13 to 14 | 343 |
| 14 to 15 | 298 |
| 15 to 16 | 192 |
| 16 to 17 | 175 |
| 17 to 18 | 139 |
| 18 to 19 | 114 |
| 19 to 20 | 84 |
| 20 to 21 | 84 |
| 21 to 22 | 46 |
| 22 to 23 | 26 |
| 23 to 24 | 34 |
| 24 to 25 | 25 |
| 25 to 26 | 17 |
| 26 to 27 | 16 |
| 27 to 28 | 5 |
| 28 to 29 | 13 |
| 29 to 30 | 10 |
| above 30 (not drawn) | 21 |
What Ashley gets, and why
The lesson
What a histogram shows
A histogram splits a numeric column into equal ranges and draws one bar per range, as tall as the number of values in it. For pages viewed, each range is a single page count, so the first bar is “sessions that viewed 1 page”, the next “2 pages”, and so on. Reading one comes down to three questions: where is the peak, how wide is the spread, and is one side longer than the other?
web_sessions["pages_viewed"].value_counts().sort_index().head()
1 17405
2 4932
3 3635
4 3003
5 2368
Skew and the mean
When the tail stretches to the right, the distribution is right-skewed. The long tail pulls the mean toward it, while the median stays with the bulk of the data:
pages = web_sessions["pages_viewed"]
pages.mean(), pages.median(), pages.skew() # 3.66, 2.0, 2.35
In a right-skewed column the mean is above the median; in a left-skewed one (rare in business data, an example is days until an expiry date) it is below. The bigger the gap, the less the mean describes a typical value.
Spikes mean a second story
A single bar far taller than its neighbours usually means a different process is mixed in. Here it’s bounces: visitors who land on one page and leave. They are 43.5% of all sessions. Mixing bouncers and browsers in one average describes neither group. Split them and each gets a useful number:
(pages == 1).mean() # 0.435 bounce rate
pages[pages > 1].median() # 4.0 pages for visits that go past the first page
The normal curve is not the default
Many statistics lessons start with the bell-shaped normal distribution, where mean and median match and about 95% of values sit within two standard deviations of the mean. Counts, money and durations in business data rarely look like that. A quick test: if the mean minus two standard deviations is impossible (a negative page count, a negative price), the data is not normal, and rules built on that shape don’t apply.
Common mistakes
- Reporting the mean without looking at the shape. Always plot the histogram first.
- Ignoring a spike. A tall bar at 0, 1 or a round number is often a separate behaviour (bounces, default values, free orders) worth its own analysis.
- Calling the tail “errors”. Long tails are normal in business data. Remove a value only when you know it is wrong, not because it is big.
Lantern lit!
Practised: histogramskewdistribution shapebounce
- Solved
- No hints
- First run
