Analysts spend a surprising amount of time on plumbing: reading CSVs, fixing column names, joining tables, and formatting charts. The actual thinking, pattern recognition, and recommendation come only after the data is clean. AI coding agents can take over much of that plumbing if you give them the right instructions.
We tested OpenCode on a typical analyst workflow: take a raw export from a product analytics tool, clean it, join it with a customer CSV, and produce a summary chart. The agent handled the mechanical parts well and flagged a few edge cases we would have missed.
What the Agent Does Well
Three tasks were consistently fast and accurate:
- Data cleaning. Renaming columns, dropping nulls, casting types, and standardizing date formats. The agent wrote pandas or polars code that ran on the first try.
- Transformations. Merging datasets, grouping, aggregations, and window calculations. As long as the schema was clear, the generated code matched the intent.
- Visualization boilerplate. Generating matplotlib, seaborn, or Plotly charts with sensible defaults. The styling needed tweaking, but the structure was right.
Store a
data_dictionary.mdfile in your project folder with table schemas, column meanings, and common join keys. The agent reads it and produces more accurate code on the first pass.
The Human Role in the Loop
The agent is good at syntax and structure. It is not good at deciding what the data means. An analyst still needs to:
- Define the question the analysis is supposed to answer
- Check that the join keys make business sense
- Verify that aggregations do not double-count or drop important rows
- Interpret whether a pattern is meaningful or a data artifact
We saw the agent produce a chart that looked correct but hid a subtle issue: it averaged a rate without weighting by denominator. The code ran, the chart rendered, and the conclusion would have been wrong. A human check on the calculation caught it.
Practical Setup
OpenCode works well for this use case because you can keep the data local. Point it at a directory with your CSVs and a Python virtual environment, and ask for scripts rather than one-off notebook cells. The result is reusable code, not a throwaway notebook.
A typical prompt: "Write a Python script that reads events.csv and customers.csv, joins on customer_id, and produces a monthly active users chart saved to output/mau.png. Handle missing customer_id values by dropping those rows."
The agent returns a script, not just a code block. You can run it, inspect the output, and iterate.
Never feed sensitive customer data or PII into a cloud-hosted model unless your compliance team has approved it. For restricted data, run OpenCode against a local model or sanitize the data first.
When to Use It and When to Skip It
Use an AI coding agent for data work when:
- The task is repetitive and well-defined
- The output is a script you can review and rerun
- The stakes of a mistake are low to moderate
Skip it when:
- The analysis informs a major business decision
- The data is sensitive and cannot be sent to a cloud provider
- The calculation requires domain-specific statistical knowledge
Originally published at pickuma.com. Subscribe to the RSS or follow @pickuma.bsky.social for new reviews.
Top comments (0)