Jupyter Notebook Python: 7 Features Every Beginner Needs
You can write Python in Notepad if you want to. So why do almost all data analysts reach for Jupyter Notebook instead? Because the notebook is not just a place to type code. It is a place to run it in small pieces, see each result at once, and keep your code, your notes, and your charts together in one file. If you have opened it and only ever used it to run print statements, you are using a small part of a powerful tool.
This guide walks through the 7 features that make Jupyter Notebook Python work such a strong pair for data. We will use one running example the whole way, a small Lagos transport business tracking danfo fares across five routes. Same data from the first feature to the last.
If the tool is not installed yet, start with our guide on how to install Jupyter Notebook in Python, then come back.
Cells: the heart of Jupyter Notebook Python work
The single most important idea is the cell. A cell is one grey box that holds a chunk of code. You run just that box with Shift and Enter, and the output appears directly below it. This is what makes writing Python in Jupyter Notebook feel different from running a whole script at once. You test one small idea, confirm it works, then move to the next.
# This is one code cell. Run it with Shift and Enter.
route = "Oshodi to Ikeja"
fare = 400 # fare in Naira for one trip
print("The", route, "route costs", fare, "Naira")
Run it and you see the line print straight away. Because each cell runs on its own, you can fix a mistake in one box and rerun only that box, instead of starting the whole program again. If you are brand new to this flow, our step by step post on how to learn Python in Jupyter Notebook is a gentle place to begin.
The kernel: why your variables stay alive
Behind every notebook is a kernel. The kernel is the engine that actually runs your Python and remembers everything you have defined. This is the real reason using Jupyter Notebook for Python is so smooth. A variable you create in the first cell is still available ten cells later.
# The kernel remembers the fare from the cell above.
# We did not define it again here.
weekly_fare_total = fare * 6
print("Six trips on that route bring in", weekly_fare_total, "Naira")
The output is Six trips on that route bring in 2400 Naira. Notice we reused fare without retyping it. If your notebook ever behaves strangely, it is often the kernel holding an old value. The fix is Kernel then Restart, which clears its memory so you can run everything fresh.
Keyboard shortcuts that speed up Python in Jupyter Notebook
Working Jupyter Notebook with Python gets fast once you stop reaching for the mouse. A few shortcuts do most of the work. Press Esc to leave a cell, then use these.
# These are keyboard shortcuts, not code to type in a cell:
# B = add a new cell Below
# A = add a new cell Above
# DD = delete the current cell (press D twice)
# M = change the cell to Markdown for notes
# Y = change it back to code
# Shift and Enter = run the cell and move to the next
Learn just those six and your speed jumps. You will build, run, and reorganise a notebook without ever leaving the keyboard.
Markdown cells: notes and code in one file (jupyter notebook in python)
Not every cell has to be code. Switch a cell to Markdown by pressing M, and you can write plain headings and notes. This is a quiet strength of Jupyter Notebook in Python work. Your explanation sits right next to the code it describes, so the notebook reads like a report.
# In a Markdown cell you would type this, then run it:
# Lagos Transport Fares
This notebook tracks danfo fares across **five routes**.
The goal is to find the busiest route and total daily takings.
When you run a Markdown cell, the hash sign becomes a big heading and the stars become bold text. Now anyone who opens your file understands what it does before they read a single line of code.
If you are getting value from this and want the structured path, our Python for Data Analysts course takes you from these notebook basics to full analysis on real Nigerian datasets, with lessons that build on each other.
Magic commands: small helpers built for python jupyter notebook work
Jupyter adds a few special commands called magics, which start with a percent sign. They are not part of normal Python. They are extra tools that only work inside the notebook, and they make Python for Jupyter Notebook tasks easier.
# %who lists every variable you have created so far
%who
# %timeit measures how long a line takes to run
%timeit sum([400, 300, 700, 350, 800])
The %who magic prints the names you have defined, which is handy when a notebook grows long and you forget what is in memory. The %timeit magic runs a line many times and reports the average speed. Both are small, but they save real time once your notebooks get bigger.
Inline tables and charts: see your data at once
This is where the pairing truly shines. When you load real data with pandas and put the table on the last line of a cell, Jupyter prints it as a clean grid. Add a chart and it appears right under the code. Nowhere is python jupyter notebook more useful than here.
# Import pandas for tables
import pandas as pd
# Our five Lagos routes, their fares, and daily trips
data = {
"route": ["Oshodi to Ikeja", "CMS to Yaba", "Ajah to CMS", "Ikeja to Yaba", "Oshodi to Ajah"],
"fare_naira": [400, 300, 700, 350, 800],
"trips_per_day": [12, 20, 6, 15, 5]
}
df = pd.DataFrame(data)
# Work out daily takings for each route
df["daily_naira"] = df["fare_naira"] * df["trips_per_day"]
# Put df last so Jupyter prints the table
df
The grid shows each route with its daily takings. Now add a chart in the next cell.
# Import the plotting library
import matplotlib.pyplot as plt
# A bar chart of daily takings per route
plt.bar(df["route"], df["daily_naira"])
plt.title("Daily Takings by Route in Naira")
plt.xticks(rotation=45, ha="right")
plt.tight_layout()
plt.show()
The chart appears inside the notebook. At a glance you can see CMS to Yaba, with its twenty trips a day, brings in the most at 6,000 Naira, while the whole business takes 24,250 Naira a day. To go further with tables like this, read how to filter, group, and summarise data in Python with pandas. Most real projects load the table from a file, so see also how to read a CSV file in Python.
Save and share your notebook file
Everything you did, the code, the notes, the table, and the chart, lives in one file that ends in .ipynb. Press Ctrl and S to save. Because the file keeps the output as well as the code, you can send it to someone and they see your results without running anything. You can also use File then Download to export it as a PDF or an HTML page for people who do not have Jupyter.
Summary of the 7 features
| Feature | What it does | How you use it |
|---|---|---|
| 1. Cells | Run code in small pieces | Shift and Enter |
| 2. Kernel | Remembers your variables | Kernel then Restart to reset |
| 3. Shortcuts | Work without the mouse | B, A, DD, M, Y |
| 4. Markdown | Notes beside your code | Press M |
| 5. Magics | Extra notebook helpers | %who, %timeit |
| 6. Inline output | Tables and charts in place | pandas, matplotlib |
| 7. Save and share | One file with results | .ipynb, export |
What to do next
Open a fresh notebook and rebuild these seven features with your own numbers. Change the routes to the ones you actually take, or swap fares for market prices. The habit of using cells, the kernel, and inline charts on real data is what turns Jupyter from a mystery into your main workspace.
When you want a guided path that uses the notebook the way analysts do every day, our Student Coding Platforms Guide walks you through setting up Jupyter, Google Colab, and the other tools properly, so you spend your time analysing data instead of fighting your setup. For a quick overview first, see our post on the best Python coding platforms for data analysts.
References
For deeper reference on the tools used here, see the official documentation:

Post a Comment