Three pandas moves you can finish after work: read a CSV, filter the rows that matter, and groupby to a number per category.
If you already write Python after work — lists, dicts, a few functions — you do not need a new job title to start analysing a spreadsheet. You need three pandas moves: read a CSV, filter the rows you care about, and group those rows so a number appears per category. That is a realistic evening. It is also the core of most working-professional data work: monthly reports, department spend, survey counts, inventory snapshots.
This guide is written for people who finish a day job and still want one useful Python habit. It is not a finished multi-week classroom. It is one sitting: open a notebook, run a few lines, and leave with a table you could paste into tomorrow’s email.
You should be comfortable opening a Python file or notebook, installing a package, and writing a for loop. If that is still new, start with Intro to Python Programming — those 19 lessons are published and cover the language you will use here.
You do not need machine learning tonight. You do not need a full NumPy course first, although NumPy sits under pandas. For table work, pandas is the library you will type.
Install pandas once:
pip install pandas
Pick a CSV you actually use. Export it from Excel or Google Sheets as .csv. Keep columns simple: a date or month, a category (team, product, region), and a number (amount, count, hours). If you cannot share work data, make a tiny file called spend.csv:
month,team,amount
2026-01,ops,1200
2026-01,sales,800
2026-02,ops,1500
2026-02,sales,900
2026-02,sales,400
Three columns. Five rows. Enough to practise the three moves without drowning in cleanup.
import pandas as pd
df = pd.read_csv("spend.csv")
print(df.head())
print(df.shape)
print(df.dtypes)
read_csv loads the file into a DataFrame — a table with named columns. head() shows the first rows so you know the load worked. shape is (rows, columns). dtypes tells you whether amount is a number or still a string. If amounts came in with commas or currency symbols, pandas may treat them as text; clean that before you sum.
Common evening mistakes:
cd first.encoding="utf-8-sig" or "big5". Try utf-8-sig first.header=0 or name columns yourself.Once df.head() looks like your spreadsheet, stop. Do not jump into charts or models. Confirm the table, then move on.
Filtering in pandas is a Boolean mask: a True/False series the same length as the table.
sales = df[df["team"] == "sales"]
feb = df[df["month"] == "2026-02"]
big = df[df["amount"] >= 1000]
Combine conditions with & and |, and wrap each condition in parentheses:
sales_feb = df[(df["team"] == "sales") & (df["month"] == "2026-02")]
This is the same idea as an Excel AutoFilter, except it is code you can re-run next month when the CSV grows. Prefer column names you can read in a year (team, amount) over Unnamed: 3.
If you filter and get an empty table, print unique values:
print(df["team"].unique())
A trailing space in "sales " is a frequent reason a filter “does nothing”. Strip text columns when the source is a human-edited spreadsheet:
df["team"] = df["team"].str.strip()
groupby splits the table, applies a calculation, and puts the pieces back together. That is the evening payoff: totals without a pivot table you click by hand.
by_team = df.groupby("team")["amount"].sum()
print(by_team)
Add a month when you need a two-level summary:
by_month_team = df.groupby(["month", "team"])["amount"].sum()
print(by_month_team)
Useful aggregations: sum(), mean(), count(), max(). For mixed stats in one pass:
summary = df.groupby("team")["amount"].agg(["sum", "mean", "count"])
print(summary)
Reset the index if you want a normal table again — for example before writing a new CSV:
summary = summary.reset_index()
summary.to_csv("team_totals.csv", index=False)
Save spend.csv next to this file and run it:
import pandas as pd
df = pd.read_csv("spend.csv")
sales = df[df["team"] == "sales"]
print("Sales rows:")
print(sales)
totals = df.groupby("team")["amount"].sum()
print("\nTotal by team:")
print(totals)
You should see three sales rows and totals for ops and sales. If the printout matches the CSV, you have the loop: load, filter, aggregate. Tomorrow you swap in a real file and change the column names.
It is not data cleaning at scale, time-series resampling, or a machine-learning pipeline. Missing values, joins across two files, and datetime indexes are the next evenings, not tonight. pandas can do all of those; stuffing them into one sitting usually means you remember none of them on Friday.
If a course page promises Python for data analysis and machine learning as a finished product, read what is actually open. A structured evening course on NumPy, pandas, and scikit-learn is what SoloQuant is building — see the course outline. It is not a set of live classroom hours you can binge this week.
Keep the script. Next CSV, change the filename and the column names. If the filter or groupby fails, print df.columns and df.head() before you search the error. That habit is worth more than a longer tutorial.
When you want the same three moves with dates, multiple files, and charts, a structured evening path is the honest next step. Until then, one CSV, one filter, one groupby is a complete night’s work.
Excel is not the enemy. If the file is small and the question is one-off, a pivot table is faster than opening a terminal. pandas earns its evening when you will ask the same question next month, or when the export has more rows than you want to click. The script is the memory: column names, the filter, the aggregation. You are not memorising ribbon clicks.
A practical rule: if you have already rebuilt the same pivot twice, move that slice into pandas. Leave formatting, comments, and the final slide in the spreadsheet. Python does the repeatable middle.
The other reason is honesty about scale. Five rows tonight are a teacher. Five thousand rows next quarter are the same three methods. That is the point of learning read_csv, a mask, and groupby together rather than collecting twenty methods you will not type.