Analyzing data with AI
Upload a spreadsheet, ask questions, check the code. About 1 h, intermediate level.
You'll be able to
- Get an AI assistant to describe a dataset and flag quality problems before any analysis.
- Check the code and assumptions behind an AI analysis, and verify one result by hand.
- Decide which data can go into which AI tool, based on privacy rules and agreements.
What happens when you upload a spreadsheet
When you give ChatGPT, Claude, Gemini or Julius a CSV or Excel file and ask a question, the assistant usually doesn't “look” at the numbers the way you would. It writes code, typically Python, runs it on your file in a sandbox, and then describes the output in plain English, often with a chart. Copilot in Excel works on the open workbook in a similar spirit.
That has one big consequence: the code is the analysis. The friendly paragraph is a description of what the code did, written by the same model, and it can gloss over choices the code made. Julius and most assistants will show the code if you ask; some show it by default.
You don't need to be a programmer to benefit, but you do need to stay the analyst. The AI is fast at the mechanics. You decide which questions matter, which assumptions are acceptable and whether the answer makes sense.
Describe before you analyze
Before asking any real question, ask the assistant to describe the dataset: “How many rows and columns? What type is each column? How many values are missing per column? Any duplicates, odd values or inconsistent formats?”
Then compare the answer with what you know. Does the row count match the source? Are the columns what the documentation says?
Common problems this step catches:
- Formatting: dates read as text, numbers stored with commas or currency symbols, stray spaces that split one category into two.
- Duplicates: repeated rows, often from joining two files, that inflate counts.
- Missing data: blanks that may mean zero, unknown or not applicable. How to handle them depends on why they're missing.
- Units and codes: thousands versus units, or a value like 999 used to mean “no answer”.
Fixing these first prevents confident answers built on a misread file.
Check the code and its assumptions
Every analysis involves choices, and an assistant makes them silently unless you ask. Watch for these:
- Missing values dropped or filled in (for example with the average), which can change results.
- Filters that quietly exclude rows, such as open cases or a year.
- Averages: a mean pulled by a few extreme values when a median would describe typical cases better, or an average of percentages that ignores group sizes.
- Outliers removed without saying so.
- Statistical tests chosen without checking their assumptions.
Ask directly: “List every decision you made about missing values, filters, outliers and grouping.” Then ask for the code, and for a line-by-line explanation of any part you don't follow.
A useful cross-check is to ask for the same result computed a different way, such as a pivot table instead of code. If the answers differ, find out why before you use either.
Verify one number, and question the story
Pick one figure the answer depends on and reproduce it yourself: filter the spreadsheet, sum a column, or build a quick pivot table. If your number matches, you've confirmed the file was read correctly and the calculation does what it claims. If it doesn't, you've found a problem before anyone else did.
Then question the interpretation:
- Does it make sense? A result that contradicts everything you know deserves a second look, not an exciting headline.
- Correlation isn't causation. Two things rising together may share a third cause.
- Groups can reverse a trend. A pattern in the combined data can disappear or flip when you split by group.
- Charts can mislead. Check axis ranges, labels and whether bars start at zero.
The assistant can help here too: ask “What are three reasons this pattern might not mean what it seems?”
Keep data where it's allowed to be
The easiest analysis mistake to make, and the hardest to undo, is uploading data you weren't allowed to share.
- Public, open data (city portals, government statistics) is the right place to practice.
- Student records are protected by FERPA and university policy. Don't upload them to personal AI accounts.
- Human-subjects research data is governed by your IRB protocol and consent forms, which may limit where it can be processed.
- Licensed or shared data often comes with a data use agreement that restricts third-party tools.
- Health and financial data carry their own legal protections.
Use USC's ChatGPT Edu workspace for university work rather than a personal account, but a university workspace doesn't override an IRB protocol or data agreement. Removing names isn't always enough to de-identify data: combinations of details such as zip code, birth date and gender can identify people. When unsure, ask your IRB, supervisor or data steward first.
A ten-minute data story, checked
Data: a city's open-data CSV of service requests (potholes, graffiti, streetlights), with open and closed dates and a neighborhood column.
Describe: the assistant reports the rows and columns, notes that “closed date” is blank for many rows, and that one neighborhood appears under two spellings. You ask it to merge the spellings.
Question: “Which neighborhood waits longest for a pothole repair?” It returns a bar chart of average days to close.
Check the code: it calculated days only for closed requests, silently dropping open ones. Neighborhoods with a backlog of old open requests look faster than they are. You ask for the median, and for the share of requests still open, per neighborhood.
Verify by hand: you filter the spreadsheet to one neighborhood's closed pothole requests and compute the median yourself. It matches.
Story: a chart of median days to close plus the share still open, with a note on what the data can't show, such as how requests were prioritized.
Try it
A short data story from a public dataset: the question you chose, one chart, the code or steps the assistant used, and a note showing one figure you verified by hand.