Skip to main content

Data analysis & artifacts

Use Nebula Agent with Python when analysis should be repeatable, when a workbook is too complex for a one-off summary, or when the result needs a chart or generated file.

Decide what should be reproducible#

A good analysis request names the input, calculation, output, and validation rule.

Prompt
Read @data/customer-feedback.csv. Write a Python script that groups responses by segment and quarter, calculates response count and average score, and saves both the script and a CSV summary under analysis/. Do not modify the source file. Report missing values before running the calculation.

Keeping the script beside its output makes the result easier to audit than a number that appears only in chat.

Work in stages#

For unfamiliar data, separate inspection from transformation:

  1. Ask for column names, types, row counts, and missing values.
  2. Confirm filters and definitions.
  3. Run the calculation.
  4. Inspect the generated table or chart.
  5. Use the verified output in a document or deck.
Prompt
Inspect @operations.xlsx and tell me which sheet and columns should be used for on-time delivery. Do not calculate or edit anything yet.

Then make the rule explicit:

Prompt
Treat an order as on time when Delivered Date is on or before Promised Date. Exclude cancelled orders. Save the monthly result as analysis/on-time-delivery.csv and the code as analysis/on-time-delivery.py.

A small auditable script#

Real code belongs in the project, not only in the conversation:

python
from pathlib import Path
import pandas as pd

source = Path("data/customer-feedback.csv")
output = Path("analysis/feedback-summary.csv")

df = pd.read_csv(source)
summary = (
    df.groupby(["segment", "quarter"], dropna=False)
      .agg(responses=("score", "size"), average_score=("score", "mean"))
      .reset_index()
)

output.parent.mkdir(parents=True, exist_ok=True)
summary.to_csv(output, index=False)

Review the script before trusting the output. Check paths, filters, joins, units, null handling, and whether a grouping can double-count records.

Create a chart#

Ask for an image with a destination and presentation constraints:

Prompt
Use analysis/feedback-summary.csv to create a 1600×900 PNG showing average score by quarter, with one line per segment. Use direct labels, include the response count in the subtitle, and save it as figures/feedback-trend.png.

Open the image from the project tree. Check labels, scale, source date, and color contrast before inserting it into a document.

Generate a deliverable#

Analysis can feed a new document without replacing the source:

Prompt
Create exports/customer-feedback-brief.docx from @analysis/feedback-summary.csv and @figures/feedback-trend.png. Include methodology, three supported findings, limitations, and the chart. Keep all source files unchanged.

Open the DOCX in the paged editor and verify every value against the summary. For a presentation, inspect every slide for text fit and object alignment.

Safety and limits#

  • Python can read and write files available to its execution environment. Review unfamiliar code before running it.
  • Use a dedicated output folder and avoid overwrite instructions until the result is verified.
  • Do not put passwords, tokens, or private keys in scripts or prompts.
  • A generated artifact is only as reliable as its source data and calculation rules.
  • CSV cannot preserve workbook formulas, multiple sheets, charts, or rich formatting.

For direct workbook editing and formula warnings, see Spreadsheets.