Python: warming up...

pandas Bridge Trainer

Built-in AI tutor. Stuck on a cell? Ask the helper on this page. It coaches against the cell you are running — it does not hand you the answer.

pandas is the table library. A pandas DataFrame is a spreadsheet you drive with code: rows and columns, a header, numbers read as numbers. This page maps a handful of pandas moves onto the Excel moves you already know — a table, AutoSum, AutoFilter, a PivotTable, and a lookup. We keep it shallow this week. Project 2 goes deeper. Read each Predict card first, then press Shift+Enter (or click Run) to execute the cell. This is real Python, running in your browser.

The data

What we are working with

A short table of AR invoices. There is no file to load — the rows below live in a string inside the page, and the first cell reads them into a DataFrame. Everything after that works on this one table.

invoices (inline CSV)id,customer,category,amount,days_overdue 1,Acme,Services,1250.00,12 2,Globex,Goods,540.50,3 3,Initech,Services,3200.00,47 4,Umbrella,Goods,125.00,0 5,Hooli,Services,980.00,61 6,Wayne,Goods,4100.00,5 7,Stark,Services,75.25,30
An inline table, on purpose. Reading a real CSV needs a file path, and paths are a separate skill (the paths and reading files trainers cover them). Here the CSV is just text in the page, read through io.StringIO, so you can focus on the pandas moves without a file getting in the way. The shape is exactly what pd.read_csv("invoices.csv") would give you.

The notebook

Five pandas moves, each one an Excel move you know

Run the cells top to bottom. Each one does in pandas what you used to do with a click in Excel. The last cell is yours to experiment in.

Where this goes

That is the shallow end of pandas: read a table, total a column, filter rows, group and aggregate, and join two tables. Every one of those is a spreadsheet move you have already done by hand — the difference is that the pandas version is written once and runs the same way on seven rows or seven hundred thousand.

This is a first look, not the whole library. Project 2 is where pandas does real work: you read actual AR data, filter and group it to answer a question, and build the table behind a chart. The five moves here — read_csv, a column with .sum(), a boolean-mask filter, groupby, and a merge — are the ones you will reach for first. Get comfortable with the Excel-to-pandas mapping now, and Project 2 is reading and grouping, not learning the syntax cold.