Skip to content

Lesson 8 ยท Documents, Artifacts and Analysis

Data Analysis and Research with Claude

Use Claude to analyze data with real code and to research with web search: frame questions, inspect the method, check sources and recompute key numbers.

Two tasks need extra care: calculating from data and gathering facts from the web. In both, Claude can use tools, and in both you can inspect how it reached the result. This lesson shows what to ask for and what to check.

Analysis with code execution

A language model predicts text, so doing arithmetic over many rows "in its head" is a weak method. With code execution and file creation turned on, Claude can write and run code against your file, then produce charts and files such as Excel, Word, PowerPoint or PDF documents. The Help Center lists this capability for all plans as of December 2026, although organization owners can turn it off, and network access is off by default in Team and Enterprise organizations. Incognito chats cannot create files or run code.

Frame the analysis

A good request defines terms. "Which product sells best?" could mean units, revenue or profit.

TEXT
The attached CSV has one row per order line.
Question: which three products brought in the most revenue in Q1 2026?
Definitions: revenue = quantity * unit_price. Exclude rows where status
is "cancelled" or "refunded".
First report: row count, date range, missing values and duplicates.
Wait for my confirmation before you calculate.
Then show the code you ran.

The pause lets you catch a wrong date format or a surprising number of duplicates before it shapes the result.

Check the method and the numbers

After the answer, check:

  1. Row counts before and after each filter.
  2. One group by hand, or with a spreadsheet.
  3. Totals: do the parts add up to the whole?
  4. Wording: does the text claim a cause when the data only shows an association?

You can recompute a key number independently. This program does the calculation with plain Python on invented data.

Python Recompute a revenue ranking yourself

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

If your total differs from the one Claude reports, find out which rows or definitions differ. Do not just accept the newer answer.

Claude can search the web when that helps. For larger questions there is a Research option, which the Help Center describes starting from the plus menu below the message box or with /deep-research, as of December 2026. It spends longer gathering and combining sources. According to the Help Center, it needs a paid plan and web search turned on. Remember that longer tasks use more of your allowance.

TEXT
Research question: what rules apply to flying a small drone as a hobby
in [country]?
Prefer official government and regulator pages.
For each claim give the source link and the date of the page.
Separate "stated by the official source" from "your interpretation".
List anything you could not confirm.

Judge the sources

A link next to a claim does not prove that the page supports it. For every claim you will act on:

  • Open the link and find the relevant passage.
  • Check who published it and when.
  • Prefer primary sources: laws, official documentation, original studies.
  • Watch for pages that merely repeat one another.
  • For disputed questions, ask for the strongest evidence on more than one side.

You can keep a simple claim log. The structure matters more than the tool.

Python Keep a claim log and find unchecked claims

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The claims are invented. Only the first one counts as verified.

A short worked example

Imagine that a shop manager asks whether weekend sales are falling. A careful session might go like this. First, Claude reports the data: the period covered, the number of rows and any missing days. The manager notices that two weekends are missing because a till export failed, and says so. Next, they agree on definitions: a weekend is Saturday and Sunday, and sales means revenue after refunds. Only then comes the calculation, with a table of weekly totals and the code that made it. Finally, the manager asks what else could explain a change, such as holidays, price changes or shorter opening hours.

The data can show that totals went down. It cannot show why unless it contains information about the possible causes, and even then you need care. A good report keeps the observation, the possible explanations and the recommended next check in separate sentences.

Keep a record

For work that others will rely on, save the original file, the final question with its definitions, the code and the date. For research, save the links and the date on which you opened them. Someone, possibly you, will ask later where a number came from.

When to stop and ask a specialist

Some questions look simple but need statistical care: small samples, many comparisons at once, missing data that is not random, or an experiment that was not planned in advance. Ask Claude to name the assumptions behind any statistical test it uses and what would make the result unreliable. If a decision with real cost depends on the answer, have someone with the right training review the method. Do not choose the one test out of many that happens to give the result you hoped for, and report the checks that did not support your idea as well.

If you cannot get such a review, say clearly in your report that the method has not been checked, and avoid wording that sounds more certain than the evidence allows.

Common mistake: asking Claude "Are you sure?" and treating a yes as verification. It may repeat the error, or it may change a correct answer. Check against the data or the source itself.

Be careful with conclusions

Analysis supports decisions; it does not make them. For medical, legal, financial or employment questions, use the output to prepare better questions for a qualified person. Anthropic's Usage Policy also sets extra requirements for some high-risk uses, including human review.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why ask for a data check before the calculation?

    Row counts, ranges and missing values reveal problems early.
  2. 2. A research answer has a link beside a claim. What should you do before relying on it?

    A source can be misread, outdated or unrelated.
  3. 3. Sales and advertising rose together. What can that alone show?

    Other factors may explain both.
  4. 4. Which is the best definition to give for a ranking?

    Explicit definitions make the result reproducible.

Summary

  • Let code do calculations, and read the code or the method.
  • Define terms and inspect the data before trusting results.
  • In research, open sources and prefer primary ones.
  • Recompute key numbers yourself and keep people in charge of decisions.

Next: Claude Projects: Knowledge and Instructions

Your progress is saved in this browser. No account needed.