Data Analysis with Python (pandas, polars, DuckDB) Module 16 – Reporting and communicating results
Writing the analysis: from notebook to decision memo
Turn a notebook into a decision memo: the answer first, evidence with comparisons, specific caveats, plain words, and a package that reruns every number.
What you will learn
- Structure a report as question, answer, evidence, caveats and next steps
- Write an executive summary that a non-technical reader can act on
- Present uncertainty, definitions and data limitations honestly
- Package a reproducible notebook or script with the memo
Before you start
What you’ll learn · Before you start
What you will learn
- Structure a report as question, answer, evidence, caveats and next steps
- Write an executive summary that a non-technical reader can act on
- Present uncertainty, definitions and data limitations honestly
- Package a reproducible notebook or script with the memo
Before you start
On this page
Trace the original four-store memo’s evidence and caveats, then meet the six original summary conditions.
Lead with the decision and keep its evidence traceable
A decision memo: A short argument that leads with a recommendation, connects it to evidence and limitations, and states the next action. turns an analysis into a choice that someone can make. It opens with the answer to the question the reader asked, then gives the evidence for it, the caveats that limit it and the next step, in that order, because many readers decide from the first lines and never reach the end. The notebook does not go to the reader. It becomes the package behind the memo: the code, the lock file and the results file from which every quoted number comes. This lesson rewrites a weak summary of a free delivery trial into a strong one, checks every number in both drafts against the results with a script, and shows how to present uncertainty, coverage and causation honestly. It ends with a package that reruns the whole analysis from nothing and an executive summary of your own.
The example is an invented trial: two of four stores offered free delivery for four weeks, and the regional manager wants to know whether all stores should. The memo answers that question in four parts.
The parts of a decision memo
Text description of the diagram
The memo starts from the question the reader asked, here "Should free delivery go to all four stores?".
Its four parts follow in reading order:
- Answer: the recommendation, in the first sentence.
- Evidence: the numbers behind the answer, each with the comparison that gives it meaning.
- Caveats: what the data covers, the period, how the groups were chosen, and what the data cannot tell.
- Next step: what to do, and what result would change the answer.
Behind the memo sits an appendix with the definitions, the data source and its licence, and the method.
Behind the appendix sits the package: the code, the lock file and the results file, which every number quoted in the memo must match.
- Answer. The recommendation, in the first sentence, phrased as something the reader can approve or reject.
- Evidence. The few numbers that support the answer, each with the comparison that gives it meaning: before and after, trial stores and the others. Give each chart one message and a headline title that states it: the UK Government Analysis Function’s chart guidance asks for a headline title that communicates the main message and warns against too many messages in one chart.
- Caveats. What the data covers and what it cannot tell, stated specifically. The Analysis Function’s guidance on quality asks for vital caveats to come up front and advises saying what you can and cannot conclude; “care must be taken” on its own, it says, is not enough.
- Next step. What to do now, and what result would change the answer.
Definitions, the data source with its licence and the method go to an appendix, where a careful reader can check them without slowing everyone else down.
Keep the original recommendation, four-store evidence and proposed next action in distinct memo parts.
The drawing shows the whole scene; its 3 steps are listed below.
Every step as text
- The original strong memo opens with a recommendation for a further eight-week trial before a permanent decision.
- The original comparison explains what changed in the four stores and the selection and duration limits on its interpretation.
- The memo separates the proposed next action from the observed evidence. Its package retains the method, source and relevant version information.
Checkpoint
Check: Lead with the decision and keep its evidence traceable
A rewrite should preserve the results and make their limits visible
Both drafts below describe the same results. The first is the kind of paragraph a notebook often ends with:
We analysed the store data from the last couple of months and found some interesting trends. The free delivery trial seems to have driven a big jump in order values of around 28%, and customers clearly liked it. Orders also went up. There were a few data issues, such as missing customer IDs, but they probably do not change the picture. It might be worth thinking about rolling free delivery out more widely if the costs work out. Recommendation: extend free delivery to stores C and D for an eight-week trial before deciding on a permanent change. In the two trial stores, average order value rose 9.1% in the four trial weeks, from 630.97 to 688.60, while it fell 1.7% in the two stores without the offer, a gap of 10.8 points. Orders per week rose 6.6% in the trial stores and fell 2.9% elsewhere, both within the 7.4% by which a store's weekly orders varied before the trial. Each free delivery costs 38, and the regional manager chose the trial stores, so part of the gap may come from the stores themselves. A second trial in C and D will show whether the gap holds and whether the extra order value pays for the deliveries. | The weak draft | The rewrite |
|---|---|
| Starts with what the analyst did | Starts with the recommendation |
| “A big jump of around 28%”, with no comparison | 9.1% in the trial stores against -1.7% in the others, a gap of 10.8 points |
| “Orders also went up” | 6.6% against -2.9%, both within the stores’ usual week-to-week variation of 7.4% |
| “Driven” and “clearly” claim a cause | Says what changed and alongside what |
| “A few data issues” dismissed | Names the caveat that matters: the trial stores were chosen, not drawn at random |
| “Might be worth thinking about” | A next step that will settle the question |
The rewrite also follows the plain-language advice of Digital.gov, the U.S. government’s guide: active voice, so it is clear who does what, the present tense where possible, and verbs rather than nouns made from verbs: “we compared the stores”, not “a comparison of the stores was carried out”.
Readability Checker Score a draft summary with several readability formulas and see its hardest sentences.Trace the unsupported 28 and the rewrite’s nine matched tokens before reviewing the sentences’ meanings.
The drawing shows the whole scene; its 3 steps are listed below.
Every step as text
- The original weak draft contains a quoted 28 that is not found in the results. Vague wording does not supply its provenance.
- The original rewrite uses nine numbers with result-field matches and explains the comparison's selection and uncertainty caveats.
- A readable sentence still needs the correct metric, unit, population and sign. Matching a numerical token is a limited check rather than proof of the sentence's meaning.
Checkpoint
Check: A rewrite should preserve the results and make their limits visible
A token match does not establish the right metric or denominator
Writing well is not enough if a number is wrong. The analysis writes its figures to results.json, and a short
script checks that every number a draft quotes has claim provenance: The link from a sentence's metric, value, unit and population to the analysis result and assumptions supporting it. when it appears there, at the precision the draft shows it:
{
"orders": 4821,
"trial_aov_before": 630.97,
"trial_aov_during": 688.6,
"trial_aov_change_pct": 9.1,
"other_aov_change_pct": -1.7,
"difference_points": 10.8,
"trial_orders_per_week_change_pct": 6.6,
"other_orders_per_week_change_pct": -2.9,
"weekly_orders_variation_pct": 7.4,
"guest_share_pct": 19.9,
"delivery_cost_per_order": 38,
"trial_weeks": 4,
"stores_in_trial": 2
} """Every number a draft quotes must be in the results, at the precision the draft shows it."""
import json
import re
with open("results.json") as f:
results = {k: v for k, v in json.load(f).items() if isinstance(v, (int, float))}
def sources(token):
"""The result keys that match a quoted number; the sign is carried by words such as "rose" and "fell"."""
value = float(token.replace(",", ""))
decimals = len(token.split(".")[1]) if "." in token else 0
return [key for key, v in results.items() if round(abs(v), decimals) == value]
for name in ["weak.txt", "strong.txt"]:
with open(name) as f:
text = f.read()
sentences = len(re.findall(r"[.!?](?:\s|$)", text))
numbers = re.findall(r"\d+(?:,\d{2,3})*(?:\.\d+)?", text) # 1,234 and 12,34,567 too
print(f"{name}: {len(text.split())} words, {sentences} sentences, {len(numbers)} number{'s' if len(numbers) != 1 else ''}")
for token in numbers:
found = sources(token)
print(f" {token:>7} {', '.join(found) if found else 'NOT IN THE RESULTS'}") Output
weak.txt: 78 words, 5 sentences, 1 number
28 NOT IN THE RESULTS
strong.txt: 128 words, 5 sentences, 9 numbers
9.1 trial_aov_change_pct
630.97 trial_aov_before
688.60 trial_aov_during
1.7 other_aov_change_pct
10.8 difference_points
6.6 trial_orders_per_week_change_pct
2.9 other_orders_per_week_change_pct
7.4 weekly_orders_variation_pct
38 delivery_cost_per_order
Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 check_numbers.py
The weak draft quotes one number, and it is not in the results. 28 % may come from an earlier version of the analysis, another period or a slip; the check cannot tell which, only that it must be traced or removed. All nine numbers of the rewrite are found, each with the result it comes from. The check rounds each result to the precision the draft shows, so 688.60 matches 688.6, and a quoted 9.1 would match 9.14 but not 9.16. It ignores signs and does not parse the meaning of words such as “fell”. Check the direction, metric, unit and denominator separately; a matching token alone does not establish those relationships.
Three more habits make the memo right as well as readable, and each has its own section after this one. Uncertainty is stated as a range the reader can use. Coverage is stated with its denominator, such as the share of orders that have a customer ID. Causal words require a justified identifying design and assumptions, whether based on random assignment or a suitable observational argument.
Match the original tokens to their named metrics before accepting the quoted 10.8-point comparison.
The drawing shows the whole scene; its 3 steps are listed below.
Every step as text
- The original result file contains the trial and other-store changes as separate metrics.
- The original numerical checker finds each quoted token in the results under its matching policy.
- A sentence can reuse a valid token with a wrong metric, unit or denominator. The analyst must still verify the relationship between the sentence and its named result.
Checkpoint
Check: A token match does not establish the right metric or denominator
Uncertainty, coverage and causal words, written with numbers Pro: opens with a Pro, Premium or Ultimate pass
A finding is only as useful as the reader’s sense of how sure it is. This part computes intervals for both gaps of the trial, reproduces a coverage problem that turns 71 % into 44 %, and runs a checker for wording that claims more than the data shows.
In this part:
- Interpret each original interval within its sampling design
- The guest-checkout policy changes the customer denominator
- Causal wording needs an explicit design and identifying argument
3 diagrams · 5 runnable examples (Python, Text) · about 8 minutes
Opening this part with your pass…
This part opens with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so this part can’t be opened at the moment. The free part above stands on its own. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
From notebook to package, with a rubric for the summary Pro: opens with a Pro, Premium or Ultimate pass
The memo is only as trustworthy as the run behind it. This part reproduces two ways a notebook gives an answer that a fresh run cannot repeat, packs the memo with everything that reruns it, scores a summary with a rubric and ends with an exercise.
In this part:
- The saved notebook must reproduce the intended cell order
- The package records inputs and reruns the actual calculation
- Use the rubric to assess meaning as well as structure
- The summary exercise keeps six explicit public conditions
4 diagrams · 6 runnable examples (JSON, Python, Text) · about 10 minutes
Opening this part with your pass…
This part opens with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so this part can’t be opened at the moment. The free part above stands on its own. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
Practise the original reporting contracts
Practice that adapts to you
Practise this lesson
6 questions about 10 ideas of this lesson. Each answer is explained at once, and what you get right is kept in this browser.
Interview questions
-
Fresher · Warm-up
What should the first two sentences of an analysis memo contain, and why?
The first sentence gives the answer to the reader's question as a recommendation they can approve or reject, such as "Extend free delivery to stores C and D for an eight-week trial before deciding on a permanent change." The second gives the main evidence with its comparison, for example the change in the trial stores against the change in the others. Many readers decide from the first lines and never reach the end, so the method, the background and the data issues come later: the caveats in their own part, the method and definitions in an appendix. Opening with what you did ("We analysed eight weeks of orders") makes the reader search for the conclusion, and a memo that buries its answer is easily read as having none.
-
Fresher to mid
Your analysis shows that customers who used the new wishlist feature spend 25 % more per order than those who did not. The product head wants the memo to say the feature increased spending. What do you write, and what would you need before claiming causation?
-
Mid to senior
Two weeks after your memo went to leadership, finance finds that one of its figures was wrong: a filter removed returned orders twice. How do you handle the correction, and what would have caught the error before the memo went out?
-
Fresher to mid
A director asks for one number: did the new onboarding emails raise 30-day retention? Your estimate is a rise of 2.1 points, with a 95 % interval from -0.4 to 4.6 points. How do you present it in the memo and in the meeting?
Key takeaways
- A decision memo has four parts in reading order: answer, evidence, caveats, next step; definitions and the method go to an appendix.
- Give every number its comparison, and use one chart per claim with a title that states the finding.
- Name caveats specifically and say what the data cannot tell.
- Check every quoted number against the results file with a script before the memo goes out.
Terms in this lesson
- claim provenance
- The link from a sentence's metric, value, unit and population to the analysis result and assumptions supporting it.
- decision memo
- A short argument that leads with a recommendation, connects it to evidence and limitations, and states the next action.
References
- Plain language guide series: Writing for understanding (Digital.gov (U.S. General Services Administration))
- Communicating quality, uncertainty and change (Government Analysis Function (UK))
- Data visualisation: charts (Government Analysis Function (UK))
- Reproducible Analytical Pipelines (RAP) strategy (Government Analysis Function (UK))
- Creative Commons Attribution 4.0 International (CC BY 4.0) (Creative Commons)
- numpy.percentile (NumPy developers)
- subprocess (Python standard library) (Python Software Foundation)
Related tools
Report a problem with this lesson
Kept only in this browser. Your Learn progress