Sub topic 11
Writing down findings next to the evidence
This chapter covers the findings log: short markdown notes that sit beside the plot or table they describe. It assumes you can run cells in Jupyter, use pandas DataFrames, and read basic statistics such as mean, median, and distribution. It builds on the univariate and bivariate sections, so you should already have a cleaned DataFrame named df.
Why findings belong next to the evidence
An EDA produces many observations. If you keep them in your head, you will lose some. If you put them in a separate document, they drift away from the code that produced them. A reader then has to trust your summary without a way to check it.
A finding written directly under its plot or table is easy to verify. The reader sees the claim and the evidence together. If you change the cleaning step later, you can look at each note and ask whether it still holds.
A findings log also forces you to separate three things that are easy to mix up:
- What you saw. A fact about the data, such as "the mean is 2.4 times the median."
- What you think it means. A hypothesis, such as "a few large orders drive the mean."
- What you will do about it. A next step, such as "check whether large orders cluster in one region."
Mixing these makes a note sound more certain than it is. Keeping them apart tells the reader which parts are measured and which are guesses.
The anatomy of a finding
Each finding has four parts. The examples in this tutorial use the same template:
- A title that states the observation in a few words.
- Evidence that points to a specific plot, table, or number.
- Hypothesis that offers a possible explanation, worded as a guess.
- Next step that names a concrete action.
Here is the template as a markdown cell:
### Finding: order amounts are right-skewed
- **Evidence:** the histogram above and the median-versus-mean gap in `describe()`.
- **Hypothesis:** a few large orders drive the mean; the median is a better summary.
- **Next step:** check whether the large orders cluster in one region.The title is a claim, not a topic. "Order amount distribution" names a subject. "Order amounts are right-skewed" says something a reader can agree or disagree with.
Placing the note
Put the note in a markdown cell directly after the code cell that produces the evidence. Do not collect all notes at the end of the notebook. A note at the end is far from its plot, and the reader must scroll back to check it.
A good rhythm for each exploration step is:
- A short markdown cell stating the question.
- The code cell that produces a plot or table.
- A markdown cell with the finding.
The question comes first so the reader knows what to look for. The finding comes last so the reader can compare it with what they just saw.
Tie numbers in notes to the code
A note that quotes a number can go stale. Suppose you write "the median amount is 54.20" and later change a cleaning rule. The median changes, but the note does not.
You can reduce this risk in two ways.
First, avoid exact numbers when a description is enough. "The mean is well above the median" stays true across small changes. Use exact numbers only when they matter.
Second, print the numbers in a code cell right above the note, so the reader sees the current values. The note can then refer to that output.
import numpy as np
import pandas as pd
rng = np.random.default_rng(42)
df = pd.DataFrame({
"region": rng.choice(["north", "south", "east"], size=500),
"amount": rng.lognormal(mean=3.5, sigma=0.8, size=500),
})
summary = df["amount"].agg(["mean", "median"]).round(2)
print(summary)
print("mean / median ratio:", round(summary["mean"] / summary["median"], 2))This cell uses generated data so it runs on its own. With your real data, you would use the cleaned df from earlier. The ratio of mean to median gives a quick, checkable measure of skew. A ratio well above 1 supports the "right-skewed" claim.
Choosing evidence that supports the claim
Evidence has to match the claim. Some common pairings:
| Claim | Suitable evidence |
|---|---|
| A variable is skewed | Histogram, plus mean versus median |
| Two groups differ | Grouped box plot, plus `groupby` summary table |
| A column has many missing values | `quality_report` output |
| Two numeric columns move together | Scatter plot, plus a correlation value |
A picture alone is often not enough. A box plot suggests that groups differ, and a groupby table gives the numbers behind that impression. Using both lets the reader check the claim two ways.
Here is a small group summary that could back up a regional finding:
by_region = (
df.groupby("region")["amount"]
.agg(["count", "median", "mean"])
.round(2)
)
print(by_region)Include the count column. A difference between two groups means little if one group has five rows and the other has five thousand.
Hypotheses are guesses
Write a hypothesis so that it can be tested. "Large orders come from one region" can be checked. "Something odd is going on with large orders" cannot.
Use words that show your confidence. "Suggests," "may," and "is consistent with" tell the reader you have not proved anything. EDA mostly generates hypotheses. Testing them usually needs more analysis, and sometimes more data.
Keeping an open-questions list
Not every observation leads to a next step you can take right away. Some need data you do not have, or a person who knows the business. Keep these in a short "Open questions" section near the end of the notebook, and link each one to the finding that raised it.
An open question might read:
- Why do 3% of orders have an amount of exactly 0? (See "Finding: zero-amount orders.") Ask the data owner whether these are free samples or errors.
This list tells the next reader what is still unknown. It also protects you from the common failure of quietly dropping a question you could not answer.
Recording negative findings
Write down what you checked and found nothing. "Amount shows no clear trend by order month" is a useful finding. It stops the next reader from repeating the check, and it records that the check was done.
Negative findings also keep your log honest. If you only record the interesting patterns, the notebook suggests the data is more dramatic than it is.
A running summary of findings
In a long notebook, scrolling to find every finding is slow. Add a short summary cell near the top, after the goals, that lists the main findings and links to the sections. Update it when you finish each major section.
Treat this summary as part of the notebook, not a separate report. If a finding changes or is rejected, change the summary in the same sitting. A summary that disagrees with the body of the notebook is worse than no summary.
Common errors
- Notes that restate the plot. "The histogram shows a histogram of amounts" adds nothing. State what the shape means.
- Findings without evidence. If you cannot point to a cell, the claim is not yet a finding.
- Stale numbers. Re-read every note after you change a cleaning step.
- Certainty without a test. Words like "proves" and "clearly" should be rare in an EDA.
- Writing notes only at the end. You will forget details, and the notes will not match the order of the work.
Exercises
Exercise
You plot amount by region and see that the south box sits higher than the others. Write a finding with a title, evidence, hypothesis, and next step. Which extra number should the evidence include, and why?
Show answer
A good answer: Title "Finding: south region has higher order amounts." Evidence: the grouped box plot and a groupby table of median and mean per region. Hypothesis: south customers may place larger orders, or a few large orders may lift the south region. Next step: check the number of rows in south and look at its largest orders. The evidence should include the count per region, because a higher median from a very small group is weak support.
Exercise
A note says "Order amounts prove that customers prefer expensive items." Name two problems with it and rewrite it.
Show answer
First, "prove" overstates what a distribution can show. Second, the note jumps from amounts to customer preference without evidence or a hypothesis label. A rewrite: "Finding: order amounts are right-skewed. Evidence: histogram and mean above median. Hypothesis: a small group of large orders raises the mean. Next step: check whether those orders share a product or region."