# Can AI analyse your data without coding?

Date: 2023-07-20 · Author: Robert Scales · https://guidetoartificialintelligence.com/en/learn/ai-analyse-data-without-coding/

**Answer:** Yes, increasingly: with ChatGPT's Code Interpreter beta, you upload a file such as a CSV of sales, ask questions in plain English, and ChatGPT writes and runs Python code behind the scenes to compute answers and draw charts. You still need to describe your data clearly and check the results, because the code can misread a column or answer a slightly different question from the one you meant.

For years, analysing a spreadsheet meant learning formulas, pivot tables or a programming language. A new ChatGPT feature changes the starting point. Code Interpreter, which OpenAI began rolling out to ChatGPT Plus subscribers on July 6, lets ChatGPT write and run code on files you upload. You ask in ordinary language, and the model does the programming in Python, a popular language for data work, then reports the result.

You do not need to read the code. It helps to know it is there, though, because that is what makes the answers different from ChatGPT's usual replies. Instead of estimating a total from patterns in text, the model calculates it, which is why arithmetic and charts are far more dependable here than in a normal chat.

## How it works

The code runs in a sandbox, a sealed-off computer environment with some temporary disk space and no internet access. The session lasts for the length of your conversation, up to a time limit, so each step can build on the one before: load the file, clean a column, then chart it. When you are done, you can download what it produced, such as a cleaned file or a chart image. OpenAI says the network block is a safety choice, so that code the model writes cannot reach out and cause side effects in the real world.

To turn it on, Plus users on the web click their name, open the beta features in settings and switch on code interpreter. Because the rollout is gradual, it may take some days to appear.

## A worked example: a small shop's sales file

Imagine a gift shop with a CSV file, a plain-text spreadsheet format where commas separate the columns, exported from its till. The first rows look like this (illustrative data):

```
date,store,product,units,unit_price
2023-01-03,Downtown,Candle,4,12.00
2023-01-03,Lakeside,Mug,2,9.50
2023-01-04,Downtown,Notebook,6,7.25
```

**Step 1: upload and describe.** Attach the file and start with an orientation request.

```prompt
This file is our shop's sales from January to June 2023. Each row is one sale line. Revenue for a row is units × unit_price. Before any analysis, tell me how many rows there are, the date range, the list of stores and products, and any blank or odd values you find.
```

This first step catches problems early: dates read as text, a product spelled two ways, a price with a dollar sign stuck to it.

**Step 2: ask the real questions.**

```prompt
Using revenue = units × unit_price: (1) total revenue by month and store, as a table; (2) the three best-selling products by revenue in each store; (3) which product grew most from Q1 to Q2.
```

**Step 3: ask for a chart.**

```prompt
Make a line chart of monthly revenue, one line per store, with labeled axes and a title. Let me download it as a PNG.
```

**Step 4: check the numbers.** This is the step people skip. Ask "Show me the code you used for the monthly totals" and read the comments, even if you do not read Python: they reveal whether it filtered, grouped or dropped anything. Then verify one number yourself. If ChatGPT says Downtown earned, say, $8,412.50 in March (illustrative), filter March and Downtown in your own spreadsheet and add up the revenue. If the two match, you can trust the method more. If they don't, ask it to explain the difference.

> **Try it:** Export a small CSV you already know well, such as a year of household expenses or a club's membership list. Ask Code Interpreter three questions you can answer yourself, and compare its numbers with yours before asking anything you can't check.

## What it is good at, and where to be careful

OpenAI's examples point to data analysis and charts, math, file editing and converting files between formats. Andrej Karpathy, formerly Tesla's director of AI, has called it "your personal data analyst." For a beginner, that is a fair picture of the best case: quick totals, tidy tables and first-draft charts without opening a formula reference.

The cautions are practical. The model can misread a column, pick the wrong date format or quietly drop rows with missing values, and its explanation of the result can be more confident than the code justifies. Your file is uploaded to OpenAI's service, so remove names, emails and anything confidential before you start. And because the sandbox has no internet access, it can't fetch outside data for you; anything it needs has to be in the files you upload.

## How do you ask a spreadsheet a question?

Treat the model like a capable new colleague who has never seen your business. First, describe the data: what one row means, what each important column holds, and how key figures are calculated. "Revenue = units × unit_price" removes a whole class of mistakes.

Second, make the question precise. "How are sales doing?" invites a vague essay. "Compare total revenue per store for April, May and June 2023, as a table, and give the percentage change from April to June" can only be answered one way. Name the time period, the grouping, the measure and the format you want.

Third, go one step at a time and ask it to show its working. Start with a summary of the file, then one question, then a check, then the next question. If a result surprises you, ask how it was calculated before you act on it. A spreadsheet question asked this way gets you an answer you can explain to someone else, which is the real test of any analysis.

## Sources

- ChatGPT — Release Notes: https://help.openai.com/en/articles/6825453-chatgpt-release-notes
- ChatGPT plugins: https://openai.com/blog/chatgpt-plugins
- OpenAI Releases ChatGPT Code Interpreter, 'Your Personal Data Analyst': https://www.datanami.com/2023/07/11/openai-releases-chatgpt-code-interpreter-your-personal-data-analyst/
