top of page

How to run EDA in Google Colab with Gemini and verify the results

4 minutes ago
9 min read
How to run EDA in Google Colab with Gemini and verify the results, title over a teal city skyline at night, Data Studios original cover

Google Colab now ships with Gemini built into the notebook, and its Data Science Agent can take an uploaded CSV, TSV, JSON or Excel file, propose an analysis plan, write and run the Python code, and present findings with charts. For exploratory data analysis (EDA), the first pass an analyst makes over a new dataset to learn its shape, gaps and oddities, that removes most of the boilerplate: loading the file, checking types, counting missing values, plotting distributions and grouping by the obvious dimensions.


The speed has a cost that Google states plainly in its own documentation. The Colab FAQ asks users to "carefully test, review, and validate all generated code", the Colab terms describe the generative code features as "still experimental", and Google's launch post for the agent carries the caption "Data Science Agent may make mistakes." An EDA that silently keeps a duplicate row or drops a record with a missing value produces totals that look plausible and are wrong.


The method below uses Gemini in Colab for the exploration and a short pandas script for the control. The worked example uses a 12-row orders file with one duplicate, two missing values and one extreme order, and gives the correct figures computed in Python so the agent's output can be checked line by line. The Colab requirements and data-handling terms were verified on Google's official pages on November 22, 2026.


··········


WHAT GEMINI IN COLAB DOES DURING EXPLORATORY DATA ANALYSIS.


Colab offers two levels of AI help inside a notebook. The first is the Gemini chat panel and code assistance: autocompletions as you type, code generation from a description, explanations of Python libraries, refactoring across cells and error fixing, where Colab "will iteratively suggest fixes in a diff view for your review", according to the FAQ. The second is the Data Science Agent, which according to Google can "analyze data, generate a plan, execute code, and present findings", and can "reason about results, self-correct errors, and adjust its plan."


For EDA the agent is the more useful of the two because it works through several steps on its own. The FAQ describes the flow: "The agent will present a plan for your review. You can then choose to execute it." The plan is the first thing to read, since it shows which cleaning decisions the agent intends to make before any number is produced. Google's launch material lists goals such as visualizing trends, filling in missing values and selecting a statistical technique as typical requests, and its sample prompts include correlation analysis and training a classifier.


Two documented boundaries shape how an EDA session behaves. Colab AI "does not directly browse the internet", although it can write code that does. It also has no access by default to your Google Drive files or to notebook secrets; it can write code that reads them only "at your explicit request." Any file the agent analyzes is therefore one you uploaded in the chat or placed in the runtime yourself.


··········


GEMINI IN COLAB REQUIREMENTS, FILE TYPES AND LIMITS.


The eligibility rules are short. The FAQ states that "access to Colab's AI features requires your Google account's age to be 18+" and that you must be in a supported locale; the agent's launch post describes availability for users "in select countries and languages" without listing them. Google says the AI features are enabled by default for eligible users. For Google Workspace accounts, access follows an on/off control held by the organization's administrator.


........


Item

What Google documents (checked November 22, 2026)

Account

Google account aged 18+, in a supported locale

Workspace accounts

Controlled by the organization's admin on/off setting

How to open

Gemini spark icon in the notebook footer opens the chat panel

File types for the agent

CSV, TSV, JSON, XLS, XLSX, XLSM, XLSB

How to supply data

Upload in the chat, or point to data already in the runtime

File size or row limit

Not published

AI usage quota by plan

Not published

Free runtime limit

Up to 12 hours per notebook, subject to availability

Pro+ runtime

Continuous execution up to 24 hours

Drive and secrets

No access by default; only via code you request


........


Colab does not publish a file size or row limit for the agent, and it does not document any difference in AI features between the free tier and the paid Pro, Pro+ or pay-as-you-go options. The paid options raise compute availability through compute units, and the FAQ notes that "Colab does not publish these limits" for usage in general. A large file that loads slowly or exhausts memory is a runtime constraint of the notebook, and the practical fix is the same one used without AI: sample the file or aggregate before loading it. For files analyzed through chat assistants rather than notebooks, the approach in our guide on analyzing a CSV over ChatGPT's 50MB limit applies the same way.


Colab Enterprise, the Google Cloud version used with BigQuery, has its own Data Science Agent documented in the BigQuery documentation, with billing and setup handled in the Google Cloud project. The steps below refer to the consumer Colab notebook.


··········


STARTING AN EDA SESSION WITH THE DATA SCIENCE AGENT.


Open a new notebook, click the Gemini spark icon in the notebook footer to open the chat panel, and upload the file in the chat. A precise first prompt saves a round of corrections, because it tells the agent which cleaning decisions you want made explicitly and reported rather than applied silently.


I uploaded orders.csv. Run an exploratory data analysis and show me the plan before running it.
1. Report the row count, column types and missing values per column.
2. Count exact duplicate rows and duplicate order_id values. Remove exact duplicates and report how many you removed.
3. Compute revenue = units * unit_price * (1 - discount_pct / 100). Treat a missing discount_pct as 0 and say so. Leave revenue empty where units is missing.
4. Summarize units (count, mean, median, quartiles) and flag outliers with the 1.5 x IQR rule.
5. Show revenue by region and by category, and total revenue.
6. List every assumption you made in a final table.

When the plan appears, read it before choosing to execute. Check that it mentions duplicates and missing values by name and that it keeps the revenue formula you specified. If the plan skips a step, ask for the change in the chat before running; correcting a plan is faster than correcting finished charts.


A second prompt after the first pass is usually worth it: "Show the rows you removed or excluded and explain why for each one." The answer exposes any filtering the agent did on its own initiative.


··········


WORKED EXAMPLE: AN ILLUSTRATIVE ORDERS FILE FOR COLAB.


The dataset below is illustrative and was built for this example. It contains one exact duplicate (order 1006 appears twice), a missing units value (order 1008), a missing discount (order 1005) and one order far larger than the others (order 1010). Empty cells are missing values.


........


order_id

order_date

region

category

units

unit_price

discount_pct

1001

2026-09-02

East

Hardware

4

120.00

0

1002

2026-09-03

West

Software

10

45.00

10

1003

2026-09-05

East

Software

3

45.00

0

1004

2026-09-08

South

Hardware

2

120.00

5

1005

2026-09-10

West

Services

1

300.00


1006

2026-09-12

East

Hardware

5

120.00

0

1006

2026-09-12

East

Hardware

5

120.00

0

1007

2026-09-15

South

Software

8

45.00

10

1008

2026-09-18

West

Hardware


120.00

0

1009

2026-09-21

East

Services

2

300.00

15

1010

2026-09-24

South

Hardware

60

120.00

20

1011

2026-09-27

West

Software

6

45.00

0


........


These four defects are the ones that most often change EDA totals in real exports: duplicated rows from a repeated extract, blank numeric fields, blank optional fields that a formula turns into missing results, and a single bulk order that dominates averages and regional totals.


··········


THE CORRECT EDA RESULTS FOR THE ORDERS FILE.


The figures below were computed in pandas with the rules stated in the prompt: exact duplicates removed, a missing discount treated as 0, revenue left empty where units is missing, and outliers flagged with the 1.5 x IQR rule on units.


........


Check

Correct result

Rows loaded / after removing duplicates

12 / 11

Missing values

units 1 (order 1008), discount_pct 1 (order 1005)

Units: count, mean, median

10 values, mean 10.1, median 4.5

Units quartiles and IQR

Q1 2.25, Q3 7.5, IQR 5.25

IQR upper fence and outliers

15.375; order 1010 (60 units)

Revenue East / South / West

1,725 / 6,312 / 975

Revenue Hardware / Services / Software

7,068 / 810 / 1,134

Total revenue

9,012 across 10 orders with revenue

South revenue without order 1010

552

Mean units without order 1010

about 4.56


........


A wrong but plausible answer is easy to produce from this file. If the duplicate is kept and the missing discount is left as missing, order 1006 is counted twice and order 1005 drops out of the revenue sum, which gives a total of 9,312 instead of 9,012. The difference is small enough to pass a quick glance, which is why the control script below checks each step separately.


import pandas as pd

df = pd.read_csv("orders.csv", parse_dates=["order_date"])
print(len(df), df.isna().sum().to_dict())
print("exact duplicate rows:", df.duplicated().sum())

d = df.drop_duplicates().copy()
d["revenue"] = d["units"] * d["unit_price"] * (1 - d["discount_pct"].fillna(0) / 100)

q1, q3 = d["units"].quantile([0.25, 0.75])
upper = q3 + 1.5 * (q3 - q1)
print("IQR upper fence:", upper, "outliers:", d.loc[d["units"] > upper, "order_id"].tolist())
print(d.groupby("region")["revenue"].sum())
print("total revenue:", d["revenue"].sum())

Paste the script into a new cell of the same notebook after the agent finishes. It runs on the same runtime and the same file, so any difference from the agent's figures points to a decision the agent made differently, which its plan or assumption table should explain. The outlier rule used here is covered in more depth in our guide on detecting outliers with IQR and z-score checks.


··········


WHERE GEMINI'S EDA OUTPUT NEEDS CHECKING.


Duplicates come first. Many generated EDA notebooks call a describe or groupby step directly on the loaded data, so a repeated row inflates every count and sum after it. Ask for the duplicate count explicitly and compare it with your own. The row-count discipline in our guide to cleaning and deduplicating a messy CSV is the same control in a different tool.


Missing values are the second source of error. pandas skips missing values in sums and means by default, so a revenue column with an empty cell quietly shrinks the total, and filling every gap with 0 or with the column mean changes the averages in the opposite direction. The correct treatment depends on what the blank means in the source system; the agent cannot know that, so the decision should come from you and appear in the assumption table.


Outliers are the third. Order 1010 alone accounts for 5,760 of South's 6,312 in revenue, and it lifts mean units from about 4.56 to 10.1. An EDA summary that reports South as the strongest region without mentioning the single bulk order is technically correct and misleading. Ask the agent to report key figures with and without flagged outliers, and keep the decision to exclude any record with a person who knows the business.


Charts deserve the same scrutiny as tables. Check axis labels against column names, check that a bar chart by region uses the deduplicated data, and check whether the chart shows sums or counts. When the agent's code fails and it proposes a fix in the diff view, read the diff: a fix that makes an error disappear by dropping rows changes the analysis. For debugging generated pandas code in general, our guide on writing and debugging pandas code with merge, groupby and NaN checks covers the common failure patterns.


··········


COLAB AI DATA HANDLING AND PRIVACY.


The Colab FAQ describes what Google collects when you use the generative AI features: "prompts, related code, generated output, related feature usage information, and your feedback." Google says it uses this data to provide, improve and develop its products and machine learning technologies, including enterprise products such as Google Cloud, and that "human reviewers may read, annotate, and process" prompts, generated output, usage information and feedback. The FAQ adds that the data is stored so that Google cannot tell who provided it, can no longer fulfill deletion requests, and is retained for up to 18 months.


Google's instruction that follows is direct: do not include sensitive, confidential or personal information in prompts or feedback. The official Colab pages checked on November 22, 2026 do not describe a consumer opt-out for these AI features. For EDA on customer, employee or financial records, that points to one of three routes: work on an anonymized or synthetic extract, run the AI on a schema-only description and apply the generated code to the real file yourself, or use a governed enterprise environment approved by your organization.


Sharing is a separate exposure. A shared notebook includes its full contents, outputs included, unless you enable the setting under Edit, Notebook settings, to omit code cell output when saving. Clear outputs that display raw rows before sharing an EDA notebook.


··········


GEMINI IN COLAB FOR EDA: WHAT GOOGLE DOCUMENTS AND WHAT IT LEAVES OPEN.


Google documents the essentials needed to start: the 18+ age requirement and supported-locale condition, the Gemini spark icon in the notebook footer, the supported file types (CSV, TSV, JSON and four Excel formats), the plan-then-execute flow of the Data Science Agent, the diff view for fixes, and the data-collection terms with human review and 18-month retention.


Google does not publish a file size or row limit for the agent, an AI usage quota by plan, or the list of supported countries and languages. Runtime length depends on the tier, with free notebooks running up to 12 hours subject to availability and Pro+ allowing continuous execution up to 24 hours, and Workspace users depend on their administrator's setting.


For the work itself, the agent handles the exploration quickly when the prompt names the cleaning rules, and a short pandas script in the same notebook confirms the figures. On the illustrative orders file the correct total is 9,012 across 10 orders with revenue, the duplicate and the two missing values must be reported, and order 1010 must be flagged before any regional comparison is trusted.


··········


FOLLOW US FOR MORE.


·····


DATA STUDIOS


·····


datastudios.org


bottom of page