No-install workflow
From an empty notebook to a saved result
Use the downloadable practice CSV so the setup is the only new variable. Once it works, replace the file with your own documented dataset.
See the path
Step 01: Create the notebook and name it for the question
Keep: a named notebook with the analysis question in the first cell.
Start with a saved notebook and a visible purpose.
Open Colab, create a notebook, and rename it sales-analysis-practice.ipynb. In the first text cell, write the question you will answer: which city has the highest revenue in this sample?
Confirm the notebook appears in the intended Google Drive location or download a copy. The notebook file and the runtime's uploaded data are separate things.
Step 02: Upload the CSV and inspect the runtime path
Keep: Check: the exact CSV filename appears in the runtime file list.
Know the exact filename pandas can access.
Run the upload helper and choose beginner-sales-practice.csv. Then list the current directory. Do not assume the browser's local path, such as Downloads, exists inside Colab.
Avoid uploading private or regulated data to a third-party notebook service unless you understand the relevant permissions and policies.
from google.colab import files import os uploaded = files.upload() print("uploaded:", list(uploaded)) print("runtime files:", os.listdir("."))Step 03: Load and verify before analysis
Keep: a load-and-audit cell that fails visibly if the wrong file is used.
Catch filename, delimiter, and shape mistakes immediately.
Load the file by the exact runtime filename. Print the first rows, expected shape, column names, and data types before calculating revenue.
The included file has 12 rows and five source columns. The assertion is a teaching check for this known file; replace it with checks appropriate to your own data.
import pandas as pd sales = pd.read_csv("beginner-sales-practice.csv") display(sales.head()) print(sales.shape) print(sales.dtypes) assert sales.shape == (12, 5)Step 04: Calculate a summary in a rerunnable cell
Keep: a sorted city summary and a two-sentence interpretation.
Produce one answer without relying on hidden manual edits.
Create revenue, group by city, and sort the result. Keep all transformations in code so restarting the runtime does not erase an undocumented spreadsheet edit.
Add a Markdown cell under the table with one finding and one limitation. The sample describes these 12 rows; it is not evidence of a broader market trend.
Self-check: the first summary row should be Cairo with revenue of 69.50. If it is not, verify that the correct file was uploaded and that revenue is units multiplied by unit price.
sales["revenue"] = sales["units"] * sales["unit_price"] summary = ( sales.groupby("city", as_index=False)["revenue"] .sum() .sort_values("revenue", ascending=False) ) display(summary)Step 05: Export outputs before the runtime ends
Keep: Finish line: downloaded summary CSV, saved notebook, and a successful restart-and-run test.
Keep the result outside temporary runtime storage.
Write the summary to a CSV, then download it to your device. You can also mount Drive for persistent file access, but that grants the notebook access to the selected Drive environment; use only the access your task requires.
Finally, restart the runtime and run all cells. You will likely need to upload the CSV again, which confirms that the notebook documents the full setup.
summary.to_csv("city-revenue-summary.csv", index=False) files.download("city-revenue-summary.csv") # Also use File > Download > Download .ipynb # when you want a local copy of the notebook.
Quality checkpoint
Treat the runtime as temporary working space.
Before closing the session, make sure every output you care about exists in Drive, GitHub, or a downloaded local file. The notebook should include the upload or data-access step so a future run does not depend on files left in an earlier runtime.
Resources, courses & more guidance
About this path
Open a notebook, upload the practice CSV, verify its path, run a pandas summary, and export the result without confusing notebook storage with runtime storage.
The storage distinction
Your notebook can persist while uploaded runtime files disappear.
Colab notebooks can be stored in Google Drive or loaded from GitHub, but the code runs in a temporary virtual machine. A CSV uploaded only to that runtime may need to be uploaded again after the runtime is recycled. This guide makes the file path and export step explicit so that behavior is not a surprise.
The live part changes
Keep the plan. Pick a course that is live today.
The guide stays useful after an offer ends. This small shelf is refreshed from Forasm's verified public catalogue, so the course can change without breaking the learning path. It never checks coupons in the browser.
Original practice materials
Download the files used in this guide
These files were created for Forasm's exercises. They are small enough to inspect manually and may be downloaded for personal practice. Link to the original guide if you share work based on an exercise.
Primary references
Official sources behind the workflow
Product behavior can change. Use these official references when a feature, setting or usage limit differs from this guide.
- Google ResearchGoogle Colab FAQOfficial explanation of notebooks, virtual machines, resource limits, Drive integration, and runtime lifecycle.Read official source
- Google ColabWelcome to ColabOfficial notebook environment and introductory examples.Read official source
- pandaspandas.read_csv referenceOfficial reference for loading a CSV into a DataFrame.Read official source
Sources checked 2026-07-30. See the editorial policy for our sourcing and corrections process.
Beginner questions
Before you continue
Do I need to install Python to use pandas in Colab?
No local Python installation is required. Colab provides a hosted notebook runtime with many common libraries. You may still need to install a package in a notebook cell when it is not available in that runtime.
Why did my uploaded CSV disappear from Colab?
Files uploaded only to the active runtime are temporary. The runtime can be recycled after inactivity or other lifecycle events. Upload again, mount appropriate persistent storage, or download outputs before the session ends.
Should I mount my whole Google Drive?
Only if persistent Drive access is useful and you understand the permission scope. For a small public practice file, uploading it directly and downloading the output is a simpler, narrower workflow.
Continue the cluster
Take the next specific step
Each guide below solves a different problem, so you can move forward without repeating the same beginner material.
- Use the setupComplete the pandas practice projectContinue from upload and audit to grouped summaries, a chart, and a written finding.Open guide
- Messier dataClean a CSV with pandasUse Colab to work through mixed dates, invalid numbers, duplicates, and missing values.Open guide
- Save the workBuild a first Python data portfolio projectPackage the notebook, data source, output, and explanation for another person to evaluate.Open guide