A data lab: Python, pandas and Jupyter on your own computer
Install Python, create an isolated environment, add pandas, NumPy and Jupyter, and open a notebook so you can load a CSV file, clean it and answer questions about it with the same tools professional analysts use.
What you need
The browser labs in this course run real Python and real pandas, so you can finish every case without installing anything. Setting up the same tools on your own computer is still worth doing: it lets you work on your own files, keep your notebooks and carry on after the course.
You need only three things, and all of them are free:
- Python 3.10 or newer from python.org. On Windows, tick “Add Python to PATH” in the installer.
- pandas and NumPy, the table and number libraries the course uses.
- Jupyter, which gives you notebooks: pages where you write a few lines of code, run them, and see the result (a table or a chart) directly underneath.
Allow about 1 GB of disk space and a few minutes of download time.
Set it up
- Open a terminal (PowerShell on Windows, Terminal on macOS, any shell on Linux) and check Python:
python --version
- Make a folder for your work and create a virtual environment, a private set of libraries for this project so that nothing you install can break another project:
mkdir data-practice
cd data-practice
python -m venv .venv
-
Switch it on. On Windows PowerShell use
.venv\Scripts\Activate.ps1; on macOS and Linux usesource .venv/bin/activate. Your prompt now starts with(.venv). -
Install the libraries:
pip install pandas numpy matplotlib jupyterlab
- Start Jupyter and create a notebook:
jupyter lab
A browser tab opens. Choose Python 3 (ipykernel) under Notebook. If you prefer Visual Studio Code, install its Python and Jupyter extensions, open the folder, create a file ending in .ipynb and choose the .venv interpreter when asked.
Check that it works
In the first notebook cell, type this and press Shift+Enter:
import pandas as pd
df = pd.DataFrame({"city": ["Lagos", "Kano", "Lagos"], "minutes": [42, 65, 51]})
print(df.groupby("city")["minutes"].mean())
You should see Kano at 65.0 and Lagos at 46.5. Now save a small CSV file (copy the first lines of any export you are allowed to use) into your folder and load it with pd.read_csv("yourfile.csv"). If df.head() shows a table, your lab works.
For every case in the course you can copy the generated file out of the lab page, save it as a .csv next to your notebook and repeat the work locally to compare the results.
Practise safely
- Use public or invented data while you learn. Good free sources are government open-data portals, the datasets in your own organisation that you are authorised to use, and files you generate yourself.
- Never put real customer or staff records in a notebook that you upload to the internet. A shared notebook keeps its output, including any table you displayed.
- Keep the raw file untouched and do all cleaning in code. Write the result to a new file, so you can always start again.
- Do not install packages from sources you do not trust, and do not run a notebook someone sends you without reading it first, because a notebook can run any code.
- Use one virtual environment per project and record the versions with
pip freeze > requirements.txtso you can rebuild it later.
Go further
- Draw your first chart with
df["minutes"].plot.hist()andmatplotlib, and label the axes. - Keep your notebooks in a Git repository, which the developer workstation guide shows how to set up, and commit after each question you answer.
- Try the same analysis in a spreadsheet and in SQL, and compare the effort and the answers. Knowing three ways to ask a question makes you hard to fool.
- Move from
pandastoscikit-learnand a simple model when you reach the machine learning course. - Join a free community such as a local data meetup or an online forum, and practise explaining your results to someone who did not see your notebook.
Courses that use this lab
- AI for Work in Practice: The Checks That Make an Assistant Safe to Use
- Backend in Practice: Build the Server Rules That Keep Services Honest
- Build with LLMs: Reliable Assistants, from Tokens to Evaluation
- Electronics in Practice: The Arithmetic Behind Real Circuits
- Firmware in Practice: The Small Rules That Decide Whether Embedded Code Works
- Home Automation in Practice: The Rules That Make a Smart Building Behave
- IoT in Practice: The Rules That Keep a Fleet of Devices Connected
- Live Sound in Practice: The Arithmetic Behind a PA That Is Loud, Clean and Safe
- Machine Learning Foundations: Predict, Test and Decide Honestly
- Monitoring and Recovery in Practice: The Numbers Behind Keeping Systems Up
- Network Automation in Practice: Python for Network Engineers
- Python for Case Files: Learn Python by Solving Small Real Jobs
- Python for Data: Clean, Analyse and Report with pandas
- Radio in Practice: The Arithmetic That Keeps a Station on Air
- Remote Access in Practice: The Rules Behind SSH, Tunnels, VPNs and What Is Exposed
- Robotics in Practice: The Arithmetic That Keeps a Robot Moving and Safe
- Security Fundamentals in Practice: Defend With Data and Python
- Service Desk in Practice: Run the Numbers Behind IT Support
- Software Engineering in Practice: Test, Fix, Review and Release Real Code
- Stage Lighting in Practice: The Arithmetic Behind a Rig That Lights, Talks and Hangs Safely
- Television in Practice: The Arithmetic That Keeps a Channel on Screen
- Virtualization in Practice: The Arithmetic Behind Hosts, Machines and Clusters
- Windows Domain in Practice: The Rules Behind Accounts, Policies and Directory Health
Other lab guides
- A virtual machine lab on your own computer
- A Linux practice machine
- A network lab with free simulators and virtual routers
- A packet-capture lab with Wireshark and tcpdump
- A network-services lab: DHCP, DNS, proxy, load balancer, time and failover
- A Windows Server and Active Directory lab
- A developer workstation: editor, Git, Python and Node
- A container and Kubernetes lab
- A monitoring lab with Prometheus and Grafana
- A security operations (SOC) practice lab
- An isolated security lab for authorised practice
- A cloud lab that cannot surprise you with a bill
- An embedded and microcontroller lab: simulators first, hardware second
- An electronics lab: simulate first, then build on a breadboard
- A Raspberry Pi lab, with or without a Pi
- A home automation lab with Home Assistant and MQTT
- An audio, video, streaming and show-control lab
- A machine learning lab: scikit-learn, notebooks and honest experiments
- An LLM lab: a free local model, embeddings and a test harness
- A TypeScript lab: Node.js, the compiler and a test runner
- A web deployment lab: Git, a free host and environment settings
Software changes quickly. Menu names and version numbers may differ a little from what you see; the ideas and the check at the end of each section stay the same. Always download from the project's own website, and read the licence terms for your situation.