← AIAP Topic CoursesAll programsHomeSearch
AIAP Topic Courses·Data Analysis·15:43

Google Colab with Gemini: One Prompt to a Full Python Notebook, and Fixing a KeyError

Data Analysis trainer (unnamed) Marketing-analytics practitioner; runs four AI data tools on one e-commerce orders dataset

The short version

  1. Colab is free (colab.research.google.com), with a T4 GPU under Runtime. New notebook in Drive, name it for the dataset, upload the file via Gemini's file button, then one prompt: all univariate, bivariate and multivariate analysis with plots, plus a regression to predict amount. Gemini writes a plan; click 'accept and auto run' (0:00-0:06).
  2. Python (pandas, Jupyter) runs behind every AI data tool. Output: distributions, frequency tables, amount by item size (XL priced higher), preprocessing, linear regression with MSE and MAE; download as .ipynb or .py - handy for interview assignments (0:07-0:13).
  3. A KeyError from a leading space in a column name: click 'Explain error' or accept Gemini's fix. 'Ideally no spaces in column names' (0:11-0:15).

At a glance, three clicks deep

Skim here first: the closed row is the glance, open is the study card with the key points and timestamps, and the ↓ link drops to that concept's full write-up below.

01Colab plus Gemini as a prompt-to-notebook analystUpload -> one prompt -> plan -> auto run -> download.›

Upload -> one prompt -> plan -> auto run -> download.

Setup (0:00-0:03)

Prompt and plan (0:03-0:06)

Output and download (0:08-0:13)

↓ Full write-up of this concept

02Fixing a KeyError with 'Explain error'Clean headers;›

Clean headers; use the fix flow.

Error and fix (0:08-0:15)

↓ Full write-up of this concept

The concepts in full

01

Colab plus Gemini as a prompt-to-notebook analyst

One sentence, one click on 'accept and auto run', and the notebook writes and executes itself - with the Python there for you to check.

PROCEDURE: colab.research.google.com > File > New notebook in Drive > rename for the dataset > '+' > Gemini > attach the CSV/Excel. Prompt (reconstructed): 'Here is sales e-commerce data. Give me all univariate, bivariate and multivariate analysis with plots, and build a regression model to predict amount.' Gemini proposes a plan (load, EDA, univariate, bivariate, multivariate, preprocessing, regression and evaluation, findings); choose step-by-step, edit, or accept and auto run. Output: distributions, descriptive stats, relationship charts, a linear regression with MSE and MAE. Download .ipynb or .py. Free; Runtime menu offers a T4 GPU. The trainer notes companies set such datasets as interview rounds.

Why it matters

Free, transparent, and produces the code - the opposite of a black box.

02

Fixing a KeyError with 'Explain error'

A single leading space in a column header broke the run. The fix button explained it and rewrote the line.

The 'e commerce platform' column carried a leading space, so pandas raised a KeyError. Click 'Explain error' (or accept Gemini's suggested fix and run). Advice: avoid spaces in column names. Also: every AI data tool - ChatGPT, Claude, Julius - runs Python behind the prompt.

Why it matters

The most common failure in AI-written analysis, and the one-click recovery.

Tools referenced

ToolCoverageMomentContext
Google ColabdemonstratedFree notebook, T4 GPU, Gemini panel
GeminidemonstratedPlan and auto-run
Pythonexplained

Action items

    Resources mentioned

    Resources
    • docLesson page on the platform

    Extraction notes

    This page was built from an auto-generated transcript, which garbles product and people's names. Those were corrected silently in everything above and logged here for transparency. The warnings flag claims that were true on the recording day but change fast.

    Transcript corrections applied

    The transcript saysThe trainer actually means
    Google CollabGoogle Colab
    ipnby.ipynb
    Charge GPT / Chart GPT / ChargeGPDChatGPT
    cloud / Cloud AIClaude
    Mishou / Misho / MISOMeesho
    main dot com / mail dot comMake.com

    True on recording day — verify before relying