By the end of this lesson you will have a workbench for data analysis (Google Colab or a coding agent), an anonymised or fake practice file loaded into it, and your first checked number: the row count.
You need: a laptop with Excel or Google Sheets, and either a personal Google account (for Colab) or a coding agent already set up (see the Claude Code, Codex or OpenCode guide) · Time: 8 minutes
In this course the AI writes small Python programs that read your data, using pandas (a free Python tool for tables, like Excel without the grid). You never write code. You write the request, read the output, and check the numbers.
You need a place where that code can run. Pick one:
- Google Colab is a free website from Google. You open a notebook (a page made of blocks called cells; each cell holds code, and its result appears right under it). The code runs on a Google computer, so nothing gets installed on your laptop. Colab has AI built in: click the Gemini spark icon at the bottom of the notebook to open a chat. You can upload a CSV or Excel file in that chat, and its Data Science Agent can plan an analysis, show you the plan, and run it only after you agree.
- A coding agent in a folder (Claude Code, Codex, OpenCode) runs on your laptop, in one project folder. Your files stay in that folder, and the agent writes and runs Python there. You already did this once in Analyse a CSV with an AI agent; the setup is the same.
Colab is faster to start. An agent is better for repeats and many files. The checking is the same. Why?Both workbenches let real code do the maths on every row. That is the big difference from pasting rows into a chat window, where the AI only predicts a number that looks right.
Every prompt in this course works on both. In Colab you type it in the Gemini chat; with an agent you type it in the agent.
If you choose Colab, read these three points from Google's own Colab FAQ first:
- Uploaded files are temporary. Your code runs on a virtual machine (a computer Google lends you for a while). Google deletes it when you are idle for a while, and it has a maximum lifetime. Your notebook is saved in Google Drive, but files you uploaded to the machine are not. Download every result file (cleaned CSV, charts, logs) before you close the tab.
- AI prompts may be read by people. When you use Colab's AI features, Google collects your prompts, the related code and the output. The FAQ says human reviewers may read them, the data is kept for up to 18 months, and you should not include confidential or personal information.
- Not everyone gets the AI. Colab's AI features need a Google account aged 18+ in a supported country. On an office Google Workspace account, your admin decides whether Colab is switched on at all.
CarefulPutting office data into your personal Google account can break your company's data policy, even if the data is anonymised. If you are not sure, ask first, and practise with the fake file from step 4 meanwhile.
Why?Most Colab surprises come from these three points: a cleaned file lost after lunch, a client list typed into a prompt, or an office account where Colab simply does not open.
Both workbenches send what the AI reads to a model on a server. So before you upload or copy any file into the agent's folder, make a safe copy in Excel:
- Delete columns the analysis does not need: customer and employee names, phone numbers, emails, addresses, PAN, Aadhaar, bank details, salaries.
- Replace names with IDs. Put the unique names on a new sheet (Data → Remove Duplicates), give each one an ID like
EMP001orCUST-0412, bring the ID into your data with XLOOKUP, then delete the name column. - Shrink identifiers. A GSTIN (the 15-character GST number) identifies a business. If you only need the state, keep its first two digits (the state code:
24is Gujarat,27is Maharashtra) in a new column and delete the GSTIN. - Keep the key file offline. The sheet that links
EMP001back to a real name stays on your laptop, in a folder the AI never sees. You will need it only at the very end, to act on a finding.
Do it now Before you upload, tick every line
Why?The analysis almost never needs to know who. "CUST-0412 in Gujarat bought Rs 1,24,500" gives the same totals as the real name, and nothing private leaves your laptop.
Here is the best trick in this course: ask the AI to invent a realistic messy file, with problems hidden in it on purpose. You practise on it with zero privacy risk, and in lesson 5 you prove that your checks find every planted problem.
Start a session just for this (a new Colab notebook, or the agent in a new folder called
practice-maker):Prompt · copy it into your AI agentWrite and run a Python script that creates a FAKE sales file for practice. Use a fixed random seed so the file is the same every time. File: practice_sales.csv, 600 invoices from 01-07-2026 to 30-09-2026, for a lighting products distributor based in Gujarat. Columns: Invoice Date (dd-mm-yyyy), Invoice No (INV-10001...), Customer ID (CUST-0001...), State, Branch (Ahmedabad, Surat, Pune, Chennai), Product, Taxable Value, CGST, SGST, IGST, Invoice Total. Rules for the clean data: Gujarat customers get CGST 9% + SGST 9%; other states get IGST 18%. Amounts in rupees. Then plant these problems and add exactly 8 exact duplicate rows (608 rows in total): - State spellings: "Gujrat" 5 times, "Orissa" 4 times, "TN" 6 times, " gujarat " with spaces 3 times, and 3 blank states - 14 Taxable Value cells stored as text: "Rs 1,24,500", "₹ 2,300", "1,200/-" styles, and 2 cells that say "NIL" - 2 Invoice Dates written as yyyy-mm-dd instead of dd-mm-yyyy - 1 invoice whose Taxable Value is 100 times too big - 1 non-Gujarat row that has both CGST and IGST filled Save a second file, answer_key.txt, listing every planted problem with its Invoice No. Use only invented IDs. Do not use any real person or company.
Download both files. Keep
answer_key.txtin a separate folder and do not open it until lesson 5. For the next steps, usepractice_sales.csvin a fresh notebook or a new agent folder, so the AI that analyses the file has never seen the answer key.Why?A check you have never seen catch a mistake is only a hope. Planted problems turn "I think my checks work" into "my checks found 8 of 8 duplicates".
The first request is never analyse this. It is "describe this, and change nothing". This is called a data profile. Upload
practice_sales.csv(or your anonymised file) and send:Prompt · copy it into your AI agentLoad [practice_sales.csv]. Do not change, clean or analyse anything yet. Read every column as text, so nothing is converted silently. Print: 1. The number of rows and columns, and the column names. 2. For each column: blank cells, number of unique values, and 3 example values. 3. Every unique value in State, with its count. 4. Every value in the amount columns that contains anything other than digits, commas and one dot, with counts. 5. How many Invoice Dates look like dd-mm-yyyy and how many do not. 6. How many rows are exact duplicates of another row. End with a short list of problems you see. Do not fix them.
You should see something like this (an agent session; Colab's chat shows the same numbers under a code cell):
Now check the very first number yourself. Open the same file in Excel, click the column A header, and read Count in the status bar at the bottom (it counts the header too, so subtract 1). Or type
=COUNTA(A:A)-1in an empty cell.Why?The row count is your first control number: a number you know for sure, from a tool you trust, that every later step must still add up to. If the AI and Excel disagree on row count, nothing after it can be trusted.
- Choose a workbench: Colab (browser, nothing to install, temporary uploads) or a coding agent in a folder (files stay with you).
- Read Colab's own rules: download results before you leave, keep confidential data out of AI prompts, and check your company's policy.
- Anonymise first: delete personal columns, replace names with IDs, keep the key file offline.
- Practise on a fake file with planted problems, and keep its answer key closed until lesson 5.
- Next: Clean before you count, with a cleaning log that records every row you lose.
Create a free account to save your progress and open every lesson. Create free account