In short
Writing a whole script and running it blind is painful when you're exploring data. Notebooks let you run one small piece, look at the result, and decide the next step.
The interactive, cell-based environment used for almost all exploratory data analysis and model prototyping in AI work.

Think of it like this
Your practical lab record
In college practicals you write the aim, do one experiment, note the observation right beside it, then move on. A notebook works the same: a cell of code, its output just below, and your notes in between. Anyone can read it later and follow along.
Watch it happen
What happens when you press Shift+Enter
Shift+Enter on cell 1
1/5You run the first cell, which loads a CSV into a variable called df.
The big ideas
What you need to know
Code cells and text cells
Code cells run Python. Markdown cells hold headings and notes explaining why you did something.
The kernel keeps state
Variables live in the kernel's memory. Run cells out of order and you can get confusing results.
Shift+Enter is your friend
Runs the cell and moves to the next one. Learn a few shortcuts and you'll fly.
Free hosted options
Google Colab and Kaggle Notebooks run in the browser, so you can start without installing anything.
See it in code
Walk through the code
1# Cell 1: load once2import pandas as pd3df = pd.read_csv("orders.csv")4 5# Cell 2: look6df.head()7 8# Cell 3: explore one question at a time9df["city"].value_counts()1/3Slow work like loading a file goes in its own cell, so you run it only once.
Three small cells instead of one long script. The last line of a cell is shown automatically, so no print needed.
Save yourself the pain
Common mistakes
Oops
Running cells in random order, then sharing a notebook that breaks for others.
Do this instead
Before sharing, use Restart and Run All. If it runs top to bottom cleanly, it's safe.
Oops
Pages of code with zero notes.
Do this instead
Add a short markdown cell above each section: what question you're answering and what you found.
Your mission
A notebook someone else can read
Quick check
You ran cell 5 before cell 2 and now see strange values. What's the cleanest fix?
Go deeper
- 1Get comfortable with cell execution order, magic commands and inline plotting.
- 2Learn keyboard shortcuts to speed up notebook work.
- 3Practice converting a messy notebook into clean, reusable functions.
More topics at this stop
Stuck on this topic? Ask an Insider
Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.